Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[FE] Text Button that makes a frame visible wont work online but in studio it works?

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.

1 comment

0

Why don't you use only a Local Script?

1 answer

To toggle the visibility of a GuiObject, no RemoteEvents 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)

This discussion is preserved as it was. New answers, comments, and votes are closed.