verb
beg(mob/merchant as mob in oview(1))
var/T = rand(1,2)
if(T == 1)
usr.wealth += 50
else
return
//Player.dm:34:error: rand: undefined proc
//Player.dm:35:error: : invalid expression
//Player.dm:34:warning: T: variable defined but not used
ID:155766
Mar 24 2011, 6:46 am
|
|
Hi all, I have a problem with a "begging" verb. What I am trying to do is create a verb, "beg", where I can go up to a merchant and beg for gold. Then the decision will be 50% chance. Please take a look at my code and let me know how I can make it work. I posted the errors in the bottom of the code too.
|
1) You haven't declared a variable for the merchant
2) The else{return} is unneeded
3) The if/else statements are indented once too much.
4) Use 0 and 1 instead of 1 and 2, so you can get rid of T completely and just put it in the if().
Try this, see if it works: