Stop Script after Leaving a Room?
The Bitter Baron
06 Nov 2016, 11:20I have set up a series of "run script after x seconds" in a cluster of rooms, which force the player to keep moving between rooms before the countdown expires in order to escape it each time. However, the countdown continues after players have left the room and it just stacks infinitely on top of any new ones activated.
I tried attaching an If player is in room requirement to the scripts, but it still continues running if they leave it does not make the script independent of that room. Is there any way I can shut down the scripts after the player leaves the room they are in, preferably with built in functions as opposed to manually written scripts.
hegemonkhan
06 Nov 2016, 13:10I believe Timers and Turnscripts (and also Commands) can be added to a room (local), which means that they're only work within that room. If this is the case, it'd be one of your better options, barring any game design desires.
Or, you can create a global (not within a room) Timer, which would mean you don't need more of them for every room you want a timer ticking, but it will take some scripting to toggle on(enable)/off(disable) the Timer as you need.
I don't think there's any way to stop a Timer's ticking, except by disabling the Timer.
personally, real time (Timers) are messy... you'd have much more (actually total) control if you used Turnscripts and their internal turns, but this will take more Attribute and 'if' Script usage to get it all set up and working.
see if this helps, and if you still need help or explanation on how to do this stuff, let me know.