Hey there!
I am the lead programmer on a game called Vington which has not yet been released. Development is going really well so far. I was just wondering, does anyone know of a way to make a “wait” system that can be cancelled when a value changes. For example:
I code a wait(5).
Now say that it has been 2 seconds and a certain value changes. Would there be a way to skip the remaining 3 seconds in the wait() to move to the next line of code?
wait would halt the thread until the given amount of time has elasped, so there’s no real way to skip a wait without needing to change how your code is organized in the event you need to ignore the remaining time
Could you not use an external module for your waits, even though that’d be pretty inefficient? If not for that you can use repeat loops to go until a set value changes or the elapsed time passes, or you could wrap it in a coroutine and check the values but once again there’d be little to no point