mob
Ramen_Guy
key = null
density = 1
icon = 'Assassin.dmi'
icon_state="Assassin"
verb
Buy()
set src. in view(1)
switch(alert("Hello! Would you like some ramen? It's only 50 gold!",,"Yes!!","No.(Mmm... Sounds good...)"))
if("Yes!!")
if(usr.Gold >= 50)
usr.Gold -= 50
src.R += 1
src.R = /obj/Ramen
usr.contents += src.R
src.R -= 1
else
usr << "You don't have enough gold."
if("No.(Mmm... Sounds good...)")
usr << "Ramen Guy: Okay, suit yourself."
this for some reaon says it works but it wont give me the item. It instead gives me an error.
You just programed it wrong. =)
For one thing, I need to see the error to be able to pinpoint the error, but I believe I see it.
What is R?
The reason it is bringing back an error, is because there is only a PATH to /obj/Ramen, it has not yet been created.
To create it, change
src.R=new/obj/Ramen
If you could tell me what R is, I could optomize (sp) this code for you too.
[EDIT: Now I see another problem.]
Why are you subtracting R-1 if R=/obj/Ramen?
It doesn't seem to serve any purpose.
If you want just to add the ramen to the contents just use:
usr.contents+=new/obj/Ramen