Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to freeze a person for 5 seconds then thaw the person?

How to freeze a person for 5 seconds then after that it thaws the person in a script.

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

3 comments

0

I don't think you need the wait() in the two for loops as the loops aren't infinite.

0

Sometimes it crashes if you dont use a wait()

0

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."

This discussion is preserved as it was. New answers, comments, and votes are closed.