ID:156215
 
I tried to make a code so that when the usr talks to a npc he recieves a shirt and jeans but i cant make it so that the usr recieves the items to his inventory i tried making a var of the shirt and jeans.
A.loc = usr.loc
B.loc = usr.loc

I added that and the vars in the talk verb action but the shirt and the jeans appeared in the turf the usr was standing.
Any help? please
Well, the inventory runs based off of the <small>contents</small> variable. So to put something in a mobs inventory, simply add it to their contents. I'll show a small demo below.

obj
shirt
// [...]
jeans
// [...]

mob
shopkeeper
verb
buy()
set src in oview(1)
switch(input("What would you like to buy?","Shirt","Jeans"))
if("Shirt")
usr.contents += new/obj/shirt
else if("Jeans")
usr.contents += new/obj/jeans
In response to DarkeWarrior
the line of usr.contents = ....
what should i put in contents?
i have nothing to show that they will go to the inventory.
In response to DarkeWarrior
i wanted to use this but make the shopkeeper to look different to the basic charator becuase i have got mob as basioc charater how would i change this
In response to Jamesy577
Are you referring to its icon? Change it's icon variable...
In response to Spunky_Girl
well i got coding mob
icon "basic player.dmi"
so all my mob are that icon but i don't kniow how else to do it
In response to Jamesy577
So change its <small>icon_state</small>. If they're all in the same file.