Reditect
(Reditect)
April 30, 2022, 10:45pm
#1
Hey there.
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.)
2 Likes
Focia19
(Focia19)
May 18, 2022, 5:48pm
#3
Following up!
The issue should be fixed now. Can you confirm @Reditect ?
Thank you!
1 Like
Reditect
(Reditect)
May 18, 2022, 9:25pm
#4
Hey, I am no longer having the issue in games, but still have the issue in Studio.
Hey, thanks for looking into it! The issue is no longer happening inside a Roblox game, but still seems to be happening inside Roblox Studio.
I wasn’t exactly sure if it was a bug at first so I made a scripting help and feedback post that was turned into a bug report. Sorry for any of the confusion this might have caused.
Here is an image of my studio version:
(0.526.0.5260426)
My apologies, I turned it on a bit early. The change should be out with version 527. Can you update and check again?
2 Likes
Reditect
(Reditect)
May 19, 2022, 12:24am
#6
Heyo, sorry for the somewhat late reply. I updated and the bug seems to no longer be an issue. Thanks for all the help.
1 Like
This topic was automatically closed after 2 days. New replies are no longer allowed.