im stumped!
on my game im making a give gold code. so you can be anywhere in the world and give gold!
this is my code
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
mob/verb
Give(mob/M in world, amt as num)
set category ="Other"
switch(input("Do you want to give [M] soem gold?.","Gold")in list("Yes","No"))
if("Yes")
if(usr.Gold>=0)
usr.Gold-=amt
alert("You gave [M] [amt] Gold.")
M << "[usr] gave you [amt] gold"
else
alert("You don't have enough gold.")
if("Not")
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
how can i fix that so itll work? i mean it sure takes the gold from me but doesnt give it to the other.
please help this is agrivating.
- Kyle
ID:261248
Nov 12 2001, 3:58 pm
|
|
In response to Nadrew
|
|
thanks
|
if("Yes") It ain't a brain surgeon, you know -- it can't assume that when you subtract gold, you want to add it to someone else. Now, naturally, if you also added to M when subtracting from usr, it'd work better. =P Another small problem: you should compare usr.Gold to the amt, not to 0, since you want to find out if they have enough to give that amount, not if they have enough money to be able to give at least 0. |
This is very simple to do: