local rs = game:GetService("ReplicatedStorage")
local plr = script.Parent.Parent.Parent.Parent.Parent
function onClick()
if
plr.PlayerGui.GameGui.Enabled == true
then
rs.ToggledEvent:FireServer()
elseif
plr.PlayerGui.GameGui.Enabled == false
then
rs.UnToggledEvent:FireServer()
end
end
script.Parent.MouseButton1Click:connect(onClick)
help would be appreciated!

2 comments
Its a GUI, you dont have to call the server to set the Enabled property to true or else, you can just do it from the local script.
Also i believe you can just do plr.PlayerGui.GameGui.Enabled = not plr.PlayerGui.GameGui.Enabled in one line instead of the if statement.