mob/var/mob/shopkeeper
mob/NPC/Shopkeeper
text = "<font color=#66CD00>@</font>"
density = 1
var/TagSave = 1
var/list/inventory = list(new/obj/Stick)
Click()
if(src in oview(4))
usr.shopkeeper = src
usr.client.screen += new/obj/SHUD/BG1
mob/proc/Buy(mob/shopkeeper/M)
var/choice = input("What do you want to buy?") as null|obj in M.inventory // Line 35
if(choice == null)
return
if(src.gold >= choice:price)
src.contents += choice
M.inventory -= choice // Line 40
src.gold -= choice:price
else
alert("You don't have enough gold")
obj/SHUD/BG1
text = "<font bgcolor=#A52A2A>B</font>"
layer=MOB_LAYER+11
screen_loc="5,8"
Click()
usr.Buy(usr.shopkeeper)
I tried that but i get this:
Test.dm:35:error:M.inventory:undefined type: M.inventory
Test.dm:40:error:M.inventory:undefined type: M.inventory
~>Jiskuha