#how to disable player control

1 messages · Page 1 of 1 (latest)

rocky ravine
#

old tutorials used playerscripts but player no longer has player scripts in the player, so how should i make player still have walkspeed for MoveTo to work, but also no controls?

winged glade
rocky ravine
rocky ravine
#

ho wdo i get player controls from it, cus when i try to even require it it has a whole buncha errors
local PlayerModule = require(game.StarterPlayer.StarterPlayerScripts:FindFirstChild("PlayerModule"))

#

yeah just requiring it makes everything error for some reason

terse crown
#

Is it in a local script?

rocky ravine
#

terse crown
#

Also you need to require the player's module not the one in StarterPlayerScripts

#

It won't work unless it's in a local script

rocky ravine
terse crown
#

So in a local script have something

local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts.PlayerModule)
local Controls = PlayerModule:GetControls()
-- Then you can do 
ControlModule:Disable()
-- and
ControlModule:Enable()

If you do want to control it from the server, consider attributes and remote events.