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

Freeze a player for a certain amount of time?

Hello, i need to freeze a player for a certain amount of time which is 15 seconds. Is anchored = true on a players torso will work?

1 comment

0

It'd be appreciated if you accept my answer if it is working.

2 answers

✓ Accepted answer

There are 3 main ways to do this although I'll only show you 2 as the other one isn't recommended.

Both ways will need the wait function - I'm assuming you are very new to scripting.

wait(howmanysecondsyouwantthemtowait)

So for the first method( the one you asked in the question) is anchored a players torso; this does work, but the player can jump around in the same spot and if you want them to completely be frozen you should use the 2nd method.

The 2nd method is to set the players walk speed and jumpower to 0 - completely freezing them) although they'll still be able to turn around.Walk speed and Jumpower are properties of a humanoid: exactly called WalkSpeed and JumpPower.

This is what both these methods look like:

Anchor

WalkSpeed/JumpPower

Technically there is another way you could do this(not the one mentioned at the start) and that is doing both of these methods - anchored the torso and setting walkspeed and jumppower to 0: Both

-- Whichever method you chose.
wait(15)
--Turn the values back to normal e.g
Player.Character.Humanoid.WalkSpeed = 16
Player.Character.Humanoid.JumpPower = 50

There you go you can now freeze a character.

1 comment

0

Major thanks.Could not figure out, because no sources were found on the internet!

if you want them absolutely stuck,

game.Players.LocalPlayer.PlayerScripts.ControlScript.Disabled = true
wait(15)
game.Players.LocalPlayer.PlayerScripts.ControlScript.Disabled = false

2 comments

0

make sure the player isn't moving forward when it gets disabled.

0

Don't mess about with key player scripts.

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