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

Freeze a player for a certain amount of time?

Asked by 6 years ago
Edited 6 years ago

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?

0
It'd be appreciated if you accept my answer if it is working. farrizbb 465 — 6y

2 answers

Log in to vote
0
Answered by
farrizbb 465 Moderation Voter
6 years ago
Edited 6 years ago

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.

0
Major thanks.Could not figure out, because no sources were found on the internet! UncleBenss -3 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

if you want them absolutely stuck,

game.Players.LocalPlayer.PlayerScripts.ControlScript.Disabled = true
wait(15)
game.Players.LocalPlayer.PlayerScripts.ControlScript.Disabled = false
0
make sure the player isn't moving forward when it gets disabled. AttentionHog 70 — 6y
0
Don't mess about with key player scripts. farrizbb 465 — 6y

Answer this question