local part = script.Parent
local debounce = false
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local char = hit.Parent
local humanoid = char:WaitForChild("Humanoid")
local function changeAnchor()
for _, object in ipairs(char:GetChildren()) do
if object:IsA("MeshPart") then
if object.Anchored == true then
char:FindFirstChild("HumanoidRootPart").Anchored = false
object.Anchored = false
humanoid.JumpHeight = 7.2
humanoid.WalkSpeed = 16
else
humanoid.JumpHeight = 0
humanoid.WalkSpeed = 0
char:FindFirstChild("HumanoidRootPart").Anchored = true
object.Anchored = true
end
end
end
end
if not debounce then
debounce = true
changeAnchor()
wait(14)
changeAnchor()
wait(1)
debounce = false
end
end
end)
So debounce was added. This means, if you get frozen, you can't get frozen again a second.