atom
var
health
attacking
mob
Dig
verb
Dig()
for(var/turf/T in world)
set name = "Dig"
set category = "Skills"
if(usr.attacking == 1)
usr << "Your still cooling down"
if(usr.attacking == 0)
if(T.name == "Dirtwall")
usr.attacking = 1
usr << "You starting to dig [T]"
T.health -= 1
Dirtcheck()
sleep(30)
usr.attacking = 0
mob
proc
Dirtcheck()
if(src.health <=1)
if(src.name =="Dirtwall")
src.icon_state = "dirt"
src.density = 0
else
..()
turf
Dirtwall
name = "Dirtwall"
icon = 'Tiles.dmi'
icon_state = "dirtwall"
density = 1
health = 3
Problem description:
In game when I dig its spamming the message Your still cooling down and when I remove that it doesnt check the dirt cause i can hit it 10000 times but it doesnt change
There's another fundamental problem here though - Dirtcheck() is a mob proc, which means src is a mob, not the turf you're trying to dig! Yet you're treating it as if it is the turf.
In fact, nowhere do you actually figure out which turf you're digging. You need to resolve that, and then remove the loop, so that you're only digging one (player-specified) turf.
Probably the easiest method to figure out which turf you're meant to be digging is to put it as an argument to the verb, perhaps something like this:
That will allow the user to select any turf that they're next to for digging.
Then delete the "for(var/turf/T in world)" line, fix up the indentation for the lines that used to be underneath it, and make Dirtcheck() a turf proc instead of a mob proc. (The latter change will require you to call T.Dirtcheck() instead of plain Dirtcheck().)
Finally, instead of using "attacking==1" and "attacking==0", I recommend you use "attacking" and "!attacking" instead. This is a more robust method; you can read more about this here: http://byondscape.com/ascape.dmb/Wizkidd0123.2005-0129/ (scroll down to the bit labelled "The ! operator: A staple of robust coding").