Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Do I Make A Cooldown In My Run GUI?

This is my run gui script:

patiance = math.random(8,14)

function run()
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = math.random(18,24)
wait(patiance)
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16
end

script.Parent.MouseButton1Down:connect(run)

1 answer

✓ Accepted answer

you add debounce !

local debounce
patiance = math.random(8,14)

function run()
if not debounce then
debounce = true
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = math.random(18,24)
wait(patiance)
script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16
debounce = false
end
end

script.Parent.MouseButton1Down:connect(run)

This discussion is preserved as it was. New answers, comments, and votes are closed.