Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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

1 answer

Log in to vote
0
Answered by
crut24 50
9 years ago
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

0
I don't think you need the wait() in the two for loops as the loops aren't infinite. Spongocardo 1991 — 9y
0
Sometimes it crashes if you dont use a wait() crut24 50 — 9y
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." Spongocardo 1991 — 9y
Ad

Answer this question