Hey guys, I'm REALLY new to scripting so this might be really easy for all you professionals out there, aha.
But, do you know how to add a cool-down to this simple script? It'd be really appreciated. <3
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
plr.Character.Humanoid.WalkSpeed = 25 -- your power up
plr.Character.Humanoid.JumpPower = 100 -- your power up
wait(5) -- after 5 sec back to V
plr.Character.Humanoid.WalkSpeed = 16 -- back to normal
plr.Character.Humanoid.JumpPower = 50 -- back to normal
end)
Here is the original script:
local plr = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() plr.Character.Humanoid.WalkSpeed = 25 -- your power up plr.Character.Humanoid.JumpPower = 100 -- your power up wait(5) -- after 5 sec back to V plr.Character.Humanoid.WalkSpeed = 16 -- back to normal plr.Character.Humanoid.JumpPower = 50 -- back to normal end)
Try using this script:
Debounce = true local plr = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() if Debounce then Debounce = false plr.Character.Humanoid.WalkSpeed = 25 -- your power up plr.Character.Humanoid.JumpPower = 100 -- your power up wait(5) -- after 5 sec back to V plr.Character.Humanoid.WalkSpeed = 16 -- back to normal plr.Character.Humanoid.JumpPower = 50 -- back to normal Debounce = true end end)
^ Hope that helps! :D