ID:139851
 
Code:
mob
verb
drop_gold()
set category = "Channels"
set name = "Drop Zenni"
var/dropgold = input("How much you want to drop?","Drop Zenni",) as num
if(dropgold<=0)
usr << "You have to drop ATLEAST 1 zenni!"
return
if(dropgold>usr:zenni)
usr << "You dont have that much zenni to drop."
return
else
var/O = new /obj/goldbag(usr.loc)
O:zenni = dropgold
usr.zenni -= dropgold
usr << "You drop <B>[dropgold]</b> zenni"
view(6) << "[usr] drops <b>[dropgold] zenni."
return

obj/goldbag
name="Dropped Zenni"
icon='Dropped Zenni.dmi'
verb
Get()
set src in oview(0)
usr << "You get <b>[src.dropgold]</b> zenni."
usr:zenni += src.dropgold
del(src)


Problem description:the last two line are popping up as an undefined error and i have no idea why so guys plz help and thank you. :D

Although it's badly explained, I assume it's this line.

usr:zenni += src.dropgold
del(src)


The only thing I can help you with since you didn't explain what error, is that you're using : instead of .

Although I don't know if this would solve the problem, but I hear that it's bad to use :
In response to Enic
how did i explain it wrong i put the code file and i said whats wrong so if u cud rewrite the whole thing and put it how its soppose to be that would be great and the 2 lines that is popping up as an error are
usr << "You get [src.dropgold] zenni."
usr:zenni += src.dropgold
In response to Kaseem
Do you mean undentified var error? Then it means that that var doesn't exist...

Does obj/var/dropgold really exist?
In response to Enic
umm do u have a msn cuz i tihnk i can explain it better there?
In response to Kaseem
No need for that... Since I already understand the error now.

You don't have a obj/var/dropgold var. You should create it and when you drop gold, you should make the dropped obj's yen to whatever it's supposed to be.
In response to Enic
create it where and add me [email protected] because i may have some other issues in the futher and i have a .dmi item as Dropped Zenni so i think its created
In response to Kaseem
No, I don't want to add you on msn >_> I already explained how you can fix it...
In response to Enic
can u team viewer me then and do it for me because i do not understand what you mean
In response to Enic
wait nvm i get what u mean and i changed it to " var/O = new /obj/Dropped Zenni(usr.loc) " and there 1 error that says excepted end of statement
The obj/goldbag type does not have a variable named "dropgold". You need to give it a variable with that name.

Additionally, you should not be using the : operator, ever. Use the . operator, and if it gives you an error, that means you've made a mistake, and need to fix it.
In response to Kaseem
In addtion to what Garthor wrote, dropgold is a variable assigned to a verb, it will not exist after the verb has run, and you cannot access from the object.
In response to Pirion
would it help if i put obj/dropped_zenni ?
In response to Kaseem
No.

No it would not.

Perhaps you need to read some tutorials?
In response to Garthor
no i dont need to read any tutiorals im just a little rusty thats all
In response to Kaseem
A little rusty? No, you should take the advice and learn DM in the proper places, not demos.

At first, until I saw your key above it, I thought this post was a smart-alec making fun of you. Now that I realized it was you, I laughed even harder.

Kaseem-- how did i explain it wrong i put the code file and i said whats wrong so if u cud rewrite the whole thing and put it how its soppose to be that would be great and the 2 lines that is popping up as an error are
usr << "You get [src.dropgold] zenni."
usr:zenni += src.dropgold