How to freeze a person for 5 seconds then after that it thaws the person in a script.
COMMUNITY QUESTION
How to freeze a person for 5 seconds then thaw the person?
1 answer
local character = game.Workspace.Player1:GetChildren()
waitTime = 5
for i,v in pairs(character) do -- we get all the parts of the Player1 model
if v.ClassName == "Part" then -- we check if its a Part
v.Anchored = true
end
wait()
end
wait(waitTime)
for i,v in pairs(character) do -- we get all the parts of the Player1 model
if v.ClassName == "Part" then -- we check if its a Part
v.Anchored = false
end
wait()
end
Good luck mate
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
I don't think you need the wait() in the two for loops as the loops aren't infinite.
Sometimes it crashes if you dont use a wait()
Yeah, but that's only if you forget the wait() in an infinite loop. This isn't an infinite loop. "Avoid using infinite loops that do not have a delay between iterations. This kind of loop can freeze your game."