I am trying to make a tycoon, well I have a button that makes a frame visible. The script is FE.
ClientSide Script:
script.Parent.MouseButton1Click:connect(function() game:GetService("ReplicatedStorage").Events.OpenBuildTab:FireServer() end)
ServerSide Script:
game:GetService("ReplicatedStorage").Events.OpenBuildTab.OnServerEvent:connect(function(player) player:WaitForChild("PlayerGui"):WaitForChild("HUD").BuildTab.Visible = true end)
I do not get any errors in online and studio play. It works in studio but dosen't work online.
To toggle the visibility of a GuiObject
, no RemoteEvent
s are needed at all!
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Enabled = not script.Parent.Parent.Enabled -- Assuming the textbutton’s parent is a screengui end)