I am having an issue when it comes to disabling a players controls inside of a game. If the player changes input types, for example using an Xbox remote, the players controls are automatically enabled. This means that if I disable the controls, a player can bypass it and thus break many things in my game such as NPC interaction.
I am using the way Roblox provided here: New Player Scripts are coming (10.11.18), and how you can prepare - #16 by AllYourBlox
Here is a basic script of it:
local LocalPlayer = game:GetService("Players").LocalPlayer local Controls = require(LocalPlayer.PlayerScripts.PlayerModule):GetControls() Controls:Disable()
If you have a PC and an Xbox controller, then you can test it out yourself in this Roblox Studio file:
Controls Toggle - Testing Baseplate.rbxl (38.0 KB)
You can also try it in this Roblox game:
Here is a video of me testing it out: (walking into the blue part disables the players controls.)