For example player touched a part, which cause him activate GUI. While GUI is active, WASD and Space must not work. So, im not sure, what function from UserInputService i supposed to use for that.
COMMUNITY QUESTION
How to turn off input keys for some time?
2 answers
Just change the players jump power and the walkspeed
local player = game.Player.LocalPlayer
local humanoid = player:WaitForChild('Character').Humanoid
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
and the default walkspeed is 16 and the default jump power is 50 just check if the frame is visible to disable walking
If someone has the same question, there is a way to disable controls:
--// Require Controls in LocalScript
local controls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()
--// Disabling Controls
controls:Disable()
--// Enabling Controls
controls:Enable()
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
u can anchored the humanoidrootpart to make sure they cant move
Seems like it's an artisanal way to do it. At least, there will be animations of moving. Any other way?
you can set the humanoids walk speed and jump power to 0