ID:168959
 
I have /obj/Pieces/Lich.
/obj/Pieces has a verb called Attack Roll.

How do I:
1) Just make the Lich lose the Attack Roll verb, no matter what
2) Make Lich lose the attack roll if its unspawned variable = 1 and gain it again when its unspawned variable = 0
src.verbs -= /the/full/path/to/the/_verb/or/_proc/
eg
src.verbs -= /mob/verb/say
or
// this time src is the obj lich
src.verbs -= /obj/proc/attackroll
In response to Zmadpeter
Yes, but how to check if at any time the variable = 1?
In response to VDZ
If you can't even test a variable to see if it equals a certain value, then you shouldn't be posting in 'code problems'. You should be reading up on if(), and read just about ANY demo, as they will most likely have an if() statement to test variables.
In response to Crashed
I know very well how if works.
But if cannot just be placed in /obj/Pieces/Lich.
It will need something to trigger.
I need it to trigger, say, every 2 seconds. But I don't know how to do that.
In response to VDZ
Create a proc:
obj/Peices/Lich/proc
remverb()
if(src.variable==1)
src.verb-=/obj/Peices/Lich/verb/whatever
sleep(20)
remverb()
In response to VDZ
proc/FunTimeCheckerForTheUglyLich()
if(funnyvariableforthelichtoloseattackhaha==1)
src.verbs -= /mob/verb/FunTimeHappyTreeFriendsLovableHippieHuggers
sleep(20)
FunTimeCheckerForTheUglyLich()
In response to Jamesburrow
Jamesburrow wrote:
Create a proc:
obj/Peices/Lich/proc
> remverb()
> if(src.variable==1)
> src.verbs-=/obj/Peices/Lich/verb/whatever
> sleep(20)
> remverb()


Beat me to it. >:(
In response to Sinoflife
Since your checking to see if ( variable equals 1 ), just do if( variable ) unless you're doing things for each number. ( Like something for 1, something for 2, something for 3, etc. )