local bool = false
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and not bool then
bool = true
hit.Parent.Humanoid.WalkSpeed -=18
wait(X)
bool = false
end
end)
I want this cool down to be for the palyer who touched it not for everyone else in the server.
local player = game.Players.LocalPlayer
local bool = false
local X = 0.2 -- Replace with your desired wait time in seconds or you can remove and replace x
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and not bool then
bool = true
hit.Parent.Humanoid.WalkSpeed -= 18
wait(X)
bool = false
end
end)
local bool = false
local X = 2 -- Replace with your desired wait time in seconds
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and not bool then
bool = true
hit.Parent.Humanoid.WalkSpeed -= 18
wait(X)
bool = false
end
end)
Simply put this Code in a LocalScript, I made a few corrections
If you want yes, but you would have to change Wait(X) to Wait(2) or any number you need, also I learned thsi with a little of help from the DevForum and looking around the Creator Documentation, and one tutorials
If there isn’t anything more that may interact with the other Players and change their cool-down than no, thsi should work, test it and then tell me