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

How do I make it so a player can't control it's movement?

Asked by 6 years ago

I have a walking script, but the player can interrupt that script if the player tries to move, I want to make it so the player can't control it's movement and NOT make it so it can't move.

5 answers

Log in to vote
1
Answered by
FazNook 61
6 years ago

The correct way to disable a user's controls is to go inside the players dev settings. You could go ahead and change the jumppower and walkspeed but that’d be temporary. Using the below script would be the most efficient way you can find.

SCRIPT(EXAMPLE CONTROL DISABLED ON SPAWN)

game:GetService('Players').PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function()
    plr.DevComputerMovementMode = 'Scriptable' --Turns off controls
    plr.DevTouchMovementMode = 'Scriptable' --Just in case the player is in a mobile device(You can use another function to find out the device type)
    print('Controls Off')
    end)
    wait(10)
    plr.DevComputerMovementMode = 'UserChoice' --Turns back on
    plr.DevTouchMovementMode = 'UserChoice'
    print('Back online')
end)

I hope this answers your question. Pretty much what you need to play around with isDevComputerMovementMode. If you are using this along with the walk script, let’s say hit.Parent is the player’s model, you have to then do local plr = game.Players:GetPlayerFromCharacter(hit.Parent) and then you can pretty much use the one from the script I have provided.

NOTE THIS QUESTION HAS BEEN ANSWERED PREVIOULSY FOR ANOTHER USER

Make sure to search for your issue and post questions only if they don’t exist.

Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

There is a script in player.PlayerScripts thats called “ContolScript”.

Delete that script when a player is added.

0
or set the walkspeed to 0 oSyM8V3N 429 — 6y
0
Other than WalkSpeed, set JumpPower to 0 so as to prevent the player from moving at all. AbandonedRick 112 — 6y
0
that only disabled the jump ^^^^^^^^^^^^^^^ greatneil80 2647 — 6y
Log in to vote
0
Answered by 6 years ago

There is a script in player.PlayerScripts thats called “ContolScript” how Nexian has said, copy this script and put in lighting, so create a OnTouch, OnClicked or OnEnter event that will delete this script, and when you want he move again, create a script that will clone this script in lighting to the player again

Log in to vote
0
Answered by
Vulkarin 581 Moderation Voter
6 years ago

If you don't intend to let them move ever again then you can delete the script but if you do intend to do so instead of cloning it I would recommend just disabling it

Log in to vote
0
Answered by
sad_eyez 162
6 years ago

there is a script under PlayerScripts called ControlScript, do something like this:

local plr = game.Players.LocalPlayer
plr.PlayerScripts:WaitForChild("ControlScript").Disabled = true

Answer this question