ID:149893
 
I am trying to have an NPC drop an obj after a specific amount of time and i cant seem to get the code down correctly help would greatly be appreciated thanks

Magus_XII
Give me more details. Do you want it to drop only after you telling it to? When you login? when a new one is created?

-Rcet
In response to Rcet
Give me more details. Do you want it to drop only after you telling it to? When you login? when a new one is created?

-Rcet

what I want is after 3 min for the NPC to change icon_statesplay the action once (it's an animated state 4- frames)dissapear and leave an obj. at the same time dissplaying the X,Y coordinants of the obj in the text screen.

can you help?

-Magus_XII
In response to MagusXII
what I want is after 3 min for the NPC to change icon_statesplay the action once (it's an animated state 4- frames)dissapear and leave an obj. at the same time dissplaying the X,Y coordinants of the obj in the text screen.

The function to use is spawn(). Check this out:
mob/NPC
New()
spawn(180) // Wait 3 minutes
var/obj/your/object/O = locate() in src
if(O)
// ** Change src's icon_state on this line.
O.Move(src.loc) // Move object to the source location
world << "[O] dropped at [O.x],[O.y]"


/Andreas