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

How Do I disable every single action in a player?

Asked by 5 years ago
Edited 5 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

I want to disable every single action except the leave button esc and reset but how do i do this is there a service? By this I mean no movement only for the character

1 answer

Log in to vote
0
Answered by 5 years ago

Explanation

If you want to disable character movement, your best bet is to can make changes on the server to the player's character. Since changes on the server will replicate, you can effectively disable movement for as long as you wish by altering the WalkSpeed and JumpPower Properties of the player's Character Model Humanoid. The reason this is best done on the server is because players can undo the Humanoid adjustments on the Client, or they will not move on the Client but appear to move on the Server.

Example Server Script Code

player.Character:WaitForChild("Humanoid").WalkSpeed = 0
player.Character:WaitForChild("Humanoid").JumpPower = 0

when you want to return these values to the default simply change them to

player.Character:WaitForChild("Humanoid").WalkSpeed = 16
player.Character:WaitForChild("Humanoid").JumpPower = 50

Although not recommended, you can also Anchor the player's root part to prevent movement on either the Client or the Server:

player.Character:WaitForChild("HumanoidRootPart").Anchored = true
Ad

Answer this question