Hello Developers!
I’m making a cutscene for one of my new projects. I have added a script that disables Player Controls through a remote function from a server script but after Enabling back Controls through another separate Remote Function Roblox Studio Lags
Here is the script
local PlayerMod = require(game:GetService("Players").LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local Controls = PlayerMod:GetControls()
local ToggleDisables = game.ReplicatedStorage.RemoteEvents.ToggleEvents.ToggglePlayerDisablesEvent
local UnToggleDisables = game.ReplicatedStorage.RemoteEvents.ToggleEvents.UnToggglePlayerDisablesEvent
local function ControlsOff()
Controls:Disable()
end
local function ControlsOn()
Controls:Enable()
end
ToggleDisables.OnClientEvent:Connect(ControlsOff)
UnToggleDisables.OnClientEvent:Connect(ControlsOn)
After Enabling back Player Controls I get this error
▶ Maximum event re-entrancy depth exceeded for Instance.Changed (x4144) -
If anyone has a solution or another method for disabling player controls that would be greatly appreciated thanks for reading!