ROBLOX added the task library to enhance it and to get it to play better with the engine. The coroutine library is the original Lua implementation of threads. If you want to kill all timers no matter what, though, you don’t need to fetch the threads based on their associated TextLabels and could just iterate through the table, closing each thread. If coroutine.status(thread) = "suspended" then TimerThreads = nil -Remove from table to prevent memory leaks. If the thread exists and is currently suspended, then it can be closed. Local thread = timerThreads -Finds the thread associated with this TextLabel (if it exists). TimerThreads = task.spawn(ChangeTime, v) -Creates and runs thread, adding it to the table. I’ve modified your Delkit() and remote handler to do this: -Store threads in a lookup table where the keys are the TextLabels and the values are the threads. In order to access previous threads, they’ll need to be stored in a table that can be accessed elsewhere. The co variable is being overwritten with every new thread created.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |