ID:178884
 
i seem to be having trouble making both verbs can someone help me?
What kind of trouble?
In response to Foomer
well i guess i need a example of how you add gold into another person and how to give a item in your inventory to another person
In response to Foomer
if(amount<1) return

What ever you do don't miss this mistakes all NooBs make with this verb first time around. Otherwise you can give negative gold to people.

LJR
In response to Tazor07
mob/verb/Give(obj/O as obj in usr.contents, mob/M as mob in range(1))
O.Move(M)
src << "You give \the [O] to [M]."
M << "[src] gives you \a [O]."

mob/verb/Give_Gold(amount as num, mob/M as mob in range(1))
src.gold -= amount
M.gold += amount
src << "You give [amount] gold to [M]."
M << "[src] gives you [amount] gold."


That's basically how you do it.
In response to Tazor07
mob

verb
Give_Money(atom/M as mob in world)
set category = "Commands"
var/amount = input("How Much to [M]?") as null|num
if(amount <=0 || isnull(amount))
alert("Please eneter in a sufficient amount.")
return 0
if(amount > usr.credits)
alert("Please eneter in a sufficient amount.")
return 0
else
M:credits += amount
M << "[usr] gave you [amount] Gold!"
usr.credits -= amount
usr << "you gave [M], [amount] gold!"







Rae