If anyone has ever watched Sleitnick’s How to rig a car tutorial series, you might notice his cooldown system. I’m currently having a hard time to understand it. How does it work? I know the intention of that system is to prevent your character from sitting back if you touch the basepart but it seems too complicated to me. Can anyone explain to me and help me understand it?
Here is the code from his video:
*local cooldown = 0
- local function CoolDown(duration) *
-
local cooldowntag = tick()* -
cooldown = cooldowntag* -
delay(duration, function()* -
if cooldown = cooldowntag then* -
cooldown = 0* -
end* -
end)* - end*