I have a hat giver script but i need a cooldown for it but i don't know how. Here is the script:
script.Parent.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then local hat = game.ServerStorage.Hat:Clone() hat.Parent = hit.Parent end end)
Try this
local debounce = false script.Parent.Touched:Connect(function(hit) if debounce == false then debounce = true local hum = hit.Parent:FindFirstChild("Humanoid") if hum then local hat = game.ServerStorage.Hat:Clone() hat.Parent = hit.Parent end wait(3) debounce = false end end)
You just have to put in wait() like this:
script.Parent.Touched:Connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then wait(3) local hat = game.ServerStorage.Hat:Clone() hat.Parent = hit.Parent end end)