This script is used as a handcuff script. It is meant to disable the players ability to chat and reset, but the script is a server script, so I am having to use external scripts to handle this. I have placed two separate scripts in StarterGui, one disabling chat and reset while the other enables it. As you can see towards the bottom of this script there are a few lines in the code that enable and disable these scripts. But it isn't working.
I am given the error "ChatDisable is not a valid member of PlayerGui".
sub=nil script.Parent.Equipped:Connect(function() script.Parent.Clicker.OnServerEvent:Connect(function(player,target) if target~=nil then pcall(function() sub.Parent.Torso.Anchored=false end) sub=target player = game.Players:GetPlayerFromCharacter(script.Parent.Parent) if sub.Parent:FindFirstChild("Torso")~=nil and player then sub.Parent.Torso.Anchored=true coroutine.wrap(function() while sub.Parent.Torso.Anchored do wait() sub.Parent.Torso.CFrame=player.Character.Torso.CFrame*CFrame.new(0,0,-7) player.PlayerGui.ChatDisable.Disabled = true player.PlayerGui.ChatEnabled.Disabled = false end end)() else player.PlayerGui.ChatDisable.Disabled = false player.PlayerGui.ChatEnabled.Disabled = true end end end) end)