if("Sell")
usr.sell=1
usr<<"Click on the items you wish to sell"
mob/proc/Sell(var/obj/o as obj in src)
usr.Gold+=o.value
o.Move(src)
usr<<"<b>You sold the [o] for [o.value] gold</b>"
usr<<"<font color=green><b>[src]:</font></b> Thank you."
usr.sell=0
------------------------------------------------------------
obj/proc
Check()
if(usr.sell)
usr.Sell()
else
usr<<"Test"
------------------------------------------------------------
blah blah some random item
Click()
set src in usr.contents
src.Check()
Problem description:
When i click on the item after clicking on sell in the shop, i get a runtime error:
runtime error: Cannot read null.value
proc name: Sell (/mob/proc/Sell)
source file: NPCs.dm,50
usr: FriesOfDoom the King Dragon (/mob/player)
src: FriesOfDoom the King Dragon (/mob/player)
call stack:
FriesOfDoom the King Dragon (/mob/player): Sell(null)
Pickaxe (/obj/Pickaxe): Check()
Pickaxe (/obj/Pickaxe): Click("Inventory")
if i click on the item before i click to sell it, the "Test" goes to the usr like its supposed to. From the above i'm assuming that it can't read the obj's value, but im not sure. If thats so what do i need to change to make it work?
And second, "No put usr in proc. Ungh" -- Lummox JR
You should read this: Dream Tutor: usr Unfriendly