I'm basically making a Click-To-Move style game, and I don't want the player to use WASD (or be able to jump) And all of the solutions I've found just say to put:
for _, controller in pairs(game:GetService("ControllerService"):GetChildren()) do controller:Destroy() end
Into a localscript.
But all I get when I try this is:
Workspace.Player1.LocalScript:1: attempt to index a nil value
Hell Happened?
game:GetService("ContextActionService"):UnbindAllActions() local plr = game:GetService("Players").LocalPlayer local playerScripts = plr:WaitForChild"PlayerScripts" for _, v in pairs(playerScripts:GetChildren())) do if v.Name == "ControlScript" then v:Destroy() end end
Why would you want to disable WASD, or the controller? You could just do this:
local player = game.Players.LocalPlayer player.Character.Humanoid.JumpPower = 0 player.Character.Humanoid.WalkSpeed = 0
Local script, StarterGui.
You can even set the player's JumpPower and WalkSpeed back to normal, just do this:
local player = game.Players.LocalPlayer player.Character.Humanoid.JumpPower = 50 player.Character.Humanoid.WalkSpeed = 16
Easy. Just insert a blank LocalScript named ControlScript into the StarterPlayerScripts
folder under StarterPlayer
.