ID:266349
 
mob
GM
verb
Placenewobject(mob/M as mob in world)
set name = "Place New Object"
set category = "Player Controlls"
if(istype(M,/mob/Player))
var/obj/O = new /obj/Object (M.contents)
O.name = newobj_name
O.obj_desc = newobj_desc
O.obj_other = newobj_other
else
alert(src,"You may only place a new object in a player's inventory.","Invalid action")


I use this code to place objects in a user's inventory. However, it does not work! name, newobj_desc, and newobj_other are being set correctly, I know that much. I have the program compiled in b25. Thanks for your time!

-Lord of Water

Do new(M) rather than new(M.contents). I'll make the other approach work too though.

--Dan