So I made a script for a gui so when MouseButton1Down:connect the GUI would open. It opens and closes in studio but when I go to the game, the GUI does not open or close. Did I do something wrong?
Frame = script.Parent.Frame
Button = script.Parent.TextButton
Open = false
Button.MouseButton1Down:connect(function(open)
if Open == false then
Frame.Visible = true
Open = true
elseif Open == true then
Frame.Visible = false
Open = false
end
end)

4 comments
Is the game FilteringEnabled, and if so is this a LocalScript?
The reason this won't work is because the script runs before the gui is fully loaded. Change the locals to script.Parent:WaitForChild("Frame")
So would I say local = script.Parent:WaitForChild("Frame")?
Thanks for helping me fix it!