I'm trying to make a script where, when you click with a tool a forcefield appears and after 5 seconds it ends with a 10 second cooldown, but you're able to spam it how many times you'd like to. Can anyone help me with adding a cooldown?
local Tool = script.Parent
Tool.Activated:Connect(function()
local player = Tool.Parent
local ForceField = Instance.new('ForceField')
ForceField.Parent = player
wait(5)
ForceField:Destroy()
end)

2 comments
Thank you so much, this is exactly what I needed.
If this is the answer you were looking for, I would appreciate it if you marked it as the answer because it gives me reputation :)