Welcome to the Builder Academy

Question Teleport trigger - need advice

More
11 Apr 2018 18:29 - 12 Apr 2018 22:54 #7905 by JTP
If i need to make a teleport trigger that teleports all players to another room After x seconds. But only If they are still in the trigger room. How would i go about making that ?

Atm i my teleport triggers still teleport even If the player/players has left the room.
Last edit: 12 Apr 2018 22:54 by JTP.

Please Log in or Create an account to join the conversation.

More
13 Apr 2018 19:21 - 13 Apr 2018 19:22 #7912 by lacrc
Were you using teleport all? What about just iterating over the players currently in the room after the wait?
Something like:
Code:
wait 5s eval ppl %self.people% while %ppl% eval next %ppl.next_in_room% %teleport% %ppl% 3001 * show some messages here or force player to look maybe? * eval ppl %next% done
Last edit: 13 Apr 2018 19:22 by lacrc.
The following user(s) said Thank You: thomas

Please Log in or Create an account to join the conversation.

More
13 Apr 2018 20:54 #7913 by JTP
Replied by JTP on topic Teleport trigger - need advice
Main problem i have is that people leave the room before the teleport happends and still gets teleported :)

Please Log in or Create an account to join the conversation.

More
15 Apr 2018 04:14 #7919 by Treblin
Im not someone who's played much with dg scripts. However from a stylistic point of view would it perhaps make sense to either turn the room into an room with no exits, or perhaps have the player interact with an object for the teleportation to take effect? Just tossing out some ideas

Please Log in or Create an account to join the conversation.

More
15 Apr 2018 05:37 #7920 by JTP
Replied by JTP on topic Teleport trigger - need advice
Hope there is a Way, its an ambush Im trying to make...so it would look Wierd If people end up in a room with no exits first and have to wait to get ambushed :)

Please Log in or Create an account to join the conversation.

More
15 Apr 2018 08:20 #7921 by thomas

JTP wrote: Main problem i have is that people leave the room before the teleport happends and still gets teleported :)


Even if you do it like this?

Iacrc wrote: Were you using teleport all? What about just iterating over the players currently in the room after the wait?
Something like:

Code:
wait 5s eval ppl %self.people% while %ppl% eval next %ppl.next_in_room% %teleport% %ppl% 3001 * show some messages here or force player to look maybe? * eval ppl %next% done


What you are doing now is probably something like "echo, wait, echo, teleport %actor%". But if you add a room check before the teleport, problem fixed:
Code:
echo... wait... if (%actor.room.vnum% == %self.room.vnum%) %teleport%... end

Please Log in or Create an account to join the conversation.

Time to create page: 0.197 seconds