Hello all!
I’m sure many of you have seen my post about Roblox’s wait
function clogging up the task scheduler very easily - today I’ll be expanding the range of task-scheduler friendly functions, from just a custom wait
to other methods such as FastDelay
, FastDebris
and more to come (post any suggestions you got)!
The code is very short, and everything I’d like to point out regarding Roblox’s task scheduler has already been done on my custom wait
function thread.
Source
Dependencies you must have for this:
Current functions optimized:
-
delay
→FastDelay
-
Debris::AddItem
→FastDebris
Function behavior:
-
FastDelay:
-
Parameters:
number delayTime
,function callback
,tuple params
-
Callback parameters:
number yieldTime
,number timePassed
,tuple params
-
Return:
void
-
Parameters:
-
FastDebris:
-
Parameters:
Instance Item
,number Lifetime
-
Return:
void
-
Parameters:
Example code:
- FastDelay:
FastDelay(1, function(Message)
print('Message from the past:', Message) -- Message from the past: Hello!
end, 'Hello!')
- FastDebris:
FastDebris(workspace.Part, 1)
Possible issues:
Running any of the functions right after initiating a game can lead to inaccurate results. Use with caution!