ID:149438
 
Ok i had a arrow code working. But you could never drop arrows, so i made one and i tryed to do it with money.
obj
money
gold
icon = 'weapons.dmi'
icon_state = "gold"
var/amount = 5
var/num
verb/Get()
set src in oview(1)
usr.gold += src.amount
usr << "You got [src.amount] gold!"
del(src)
mob
var/num
verb/Drop_Gold(amount as num) // Verb on the player to drop arrows.
if(num < 1) // 0 or less is impossible
usr << "You cannot drop [usr.num] gold!"
else if(usr.gold < num) // you don't have that many...
usr << "You don't have [usr.num] gold!"
else // ok to drop.
var/obj/money/gold/A = new(usr.loc) // Create an arrow object at the users feet.
A.amount = num // Apply the amount of arrows to the object.



That is my code and i really cant figure out why it isnt working. Any help would be good.
you never subtract from usr.gold.
In response to Exadv1
Ok i did that and that wasnt the problem. whenever i try to drop an amount of gold it comes up with You cannot drop gold! without any number there. i cant think why though.
In response to Mrhat99au
Mrhat99au wrote:
Ok i did that and that wasnt the problem. whenever i try to drop an amount of gold it comes up with You cannot drop gold! without any number there. i cant think why though.

if(num < 1) // 0 or less is impossible
usr << "You cannot drop [usr.num] gold!"
else if(usr.gold < num) // you don't have that many...
usr << "You don't have [usr.num] gold!"

You need to change "num" to "amount".