ID:155764
 
    verb
beg(mob/merchant as mob in oview(1))
var/T = 1
if(T == 1)
usr.wealth += 5
usr << "merchant gives you 5 gold"
T = 0
return
else
usr << "merchant shuns you away"


the code is clean but there is a runtime error. I'm trying to make it so that if the player begs once, then he wont be able to beg at that merchant again. But It keeps giving me gold and not changing the value of T to zero. Any suggestions?
The code is done as it is read down. Because T is isolated to that code block, it will always equal 1 every time you use the verb.
There was no reason to post this twice. One problem is you're setting T to 1 as soon as you call the verb, so of course it'll never be 0. Other than that, you just have some common malpractices you probably don't even know you're doing.

Here:
mob
merchant
var
used=0
verb
beg()
set src in oview(1)
if(!src.used)
usr.wealth += 50
src.used=1
... ...
else
... ...
In response to KirbyRules
Thank you and sorry for posting it twice but no one answered the last one for almost a day.