you gotta make a flag variable in the if statement
local onCooldown = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("HumanoidRootPart") and not onCooldown then
back = save:clone()
back.Parent = location
back:MakeJoints()
onCooldown = true
wait(10)
onCooldown = false
end
end)
local location = script.Parent.Parent.Parent
local regen = script.Parent.Parent
local save = regen:clone()
local debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("HumanoidRootPart") and not debounce then
debounce = true
back = save:clone()
back.Parent = location
back:MakeJoints()
wait(10)
debounce = false
end
end)
Your debounce or cooldown should begin immediately so that the touched function doesn’t keep firing.