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!
If only the client can see it, then you don't really need to use events.
local plr = game.Players.LocalPlayer local Gui = plr.PlayerGui.GameGui function onClick() Gui.Enabled == not Gui.Enabled end) script.Parent.MouseButton1Click:connect(onClick)