How do I disable a players movement entirely?

I am trying to make it so that the player cannot use W,A,S,D or jump at all for a short period of time. I have looked in the character but can’t find any script of sorts that allows me to disable this. Can someone please tell me how i do this?

1 Like

A simple way would to be just anchor a part of the player and the deanchor

You can set their WalkSpeed and JumpHeight / JumpPower to 0, they’re members of the Humanoid within the player’s character

Links for reference:

https://developer.roblox.com/en-us/api-reference/class/Humanoid
https://developer.roblox.com/en-us/api-reference/property/Humanoid/WalkSpeed
https://developer.roblox.com/en-us/api-reference/property/Humanoid/JumpPower
https://developer.roblox.com/en-us/api-reference/property/Humanoid/JumpHeight

Oh thanks I didn’t know that. Let me try

1 Like

Oh thanks this will work since I need an animation to play at the same time.

local players = game:GetService("Players")
local player = players.LocalPlayer
local playerScripts = player:WaitForChild("PlayerScripts")
local playerModule = playerScripts:WaitForChild("PlayerModule")
local controlModule = require(playerModule)
local playerControls = controlModule:GetControls()

playerControls:Disable()
task.wait(10)
playerControls:Enable()

This is the official way of achieving this (disabling the player’s movement controls).

1 Like