ID:147990
 
I'm making a D&D Game, And for the monster attacks i have the players transported to a battle field where they fight the monster, heres where i'm stuck..... how do I get them to go back to where they where after they defeat it?
heres some of my code:
obj
troll1w1
icon = 'bg.dmi'
icon_state = ""
Entered(mob/PC/M)
if(istype(M,/mob/PC))
usr.loc = locate(6,32,2)
src.icon_state = "bf"
new/mob/troll(6,38,2)
troll1w1 = 1
troll1w1getback = src.loc


What else do i have to put on it so when they defeat the troll they go back?
I thought I could use the troll1w1getback(troll #1 in world #1)but i'm stumped on where and how to add it to my code... how do I make it wait untill they kill it then transport them back? i was gonna use a sleep() code but if they take to long, or finish early theyll have to wait =(

How Do I Make it so the code waits at "troll1w1getback = src.loc" untill they win?
No put usr in movement proc. Ungh.

Lummox JR
In response to Lummox JR
Maybe i didn't state my question right..... because Lummox JR's answer doesn't make alot of sense to me......

here's my question again...
how do I make it wait untill they finish the battle and then they get teleported back?
In response to DarkCampainger
No...
put...
usr...
in...
movement...
proc.

Ungh!

I don't see how it could be more simple...
In response to Garthor
ok.. I'll take usr out of my movement proc, but how do i make the code wait untill they are finished fighting?