Hello! Recently I had a need to create a task.wait(5) timer, that can also be cancelled upon a Remote Event being fired.
That last part is sorted out, however I have no idea on how to create a Thread with a task.wait(5) inside of it, so that I can execute and cancel it when needed.
If context is necessary: I’d like to create a timer whenever player goes out of the Safe Zone, and if they happen to still be outside of that zone after timer runs out - they get kicked. However, Timer has to reset if a player manages to get into a safe zone again.
Works perfectly fine, although a slight issue persists that before player enters a safe zone - there’s no running thread, causing it to try and close a non-existant thread. Any fixes for that?