i made a script that closes the current frame and opens another, but it only closes the current frame and doesnt open the other frame. heres the script. someone told me making it an if statement would fix but it didnt.

frame = script.Parent.Parent local nframe = game.StarterGui.Menu.About

script.Parent.MouseButton1Click:connect(function() if frame.Visible == true then frame.Visible = false end wait(0.6) if nframe.Visible == false then nframe.Visible = true end end)

8 comments

0

:Connect not :connect

0

make frame local

0

You're trying to access startergui using a local script. The actual Gui the player sees is already in their own PlayerGui under their LocalPlayer. If you'd actually provide the code instead of a gyazo, i'd be able to give an answer.

0

nframe goes to the startergui not the player's gui change it to like script.Parent -- Location

0

frame closes fine and works fine, but nframe wont open, it checks it visible but it wont actually show.

0

you can't do startergui it has to be playergui

0

You can do StarterGui but it only applies when anyone re-spawned

0

nframe is actually in StarterGui, so if its default Visible was True then the second 'if' is actually useless