So I'm trying to make a simple GUI in which when you click the button, another GUI will appear, and when you click it again, it disappears. It's work perfectly in Studio but whenever I publish it to Roblox, when I join it via Roblox website, it doesn't work and the error reads Rarities is not a valid member of ScreenGui I'm still new to scripting but I don't understand what's wrong. Here's my script.
~Note: It's Local
Button = script.Parent.TextButton
List = script.Parent.Rarities
Open = false
Button.MouseButton1Down:connect(function(open)
if Open == false then
Button.Text = "Close"
List.Visible = true
Open = true
elseif Open == true then
Button.Text = "Rarities"
List.Visible = false
Open = false
end
end)

1 comment
Add a WaitForChild for the variables thats why, In studio its all perfect but on client/real servers its not.