How can I check whether the player's control module is disabled or not?

Hi, in my game I disable the player’s controlmodule so they can’t control their character, but sometimes this doesn’t work. I had an idea to make a while loop that constantly checks if the player’s controlmodule is disabled and if it isn’t then disable it. I don’t know how to check if the player’s controlmodule is disabled though, is there some kind of method that checks whether it is? I tried reading through the controlmodule to find a method that does that but nope.

Not sure, but can’t you use ContextActionService and bind to the movement controls and simply return 0 or Enum.ContextActionResult.Sink (they are the same)?

1 Like

I know this post is very old but my idea is create a second variable. Example:

local LocalPlayer = game:GetService(“Players”).LocalPlayer
local Controls = require(LocalPlayer.PlayerScripts.PlayerModule):GetControls()
local controlEnabled = true --Second variable

workspace:WaitForChild(“Part”).Touched:Connect(function()
Controls:Disable()
controlEnabled = false

end)

LocalPlayer.CharacterAdded:Connect(function()
if controlEnabled == false then
Controls:Enable()
end end)

I have had this same problem so I am taking the opportunity to make my contribution