Trying to make this local script that is the child of the screen gui “Title Screen” close itself when the player clicks the text button “Play Button”. It is not working.
local TitleScreen = script.Parent
local PlayButton = script.Parent["Play Button"]
PlayButton.MouseButton1Click:Connect(function()
script.Parent.TitleScreen.Visible = not TitleScreen.Visible
end)
Like I said, :WaitForChild() on PlayButton and no need to do script.Parent.TitleScreen.Visible it’s just as easy to do TitleScreen.Visible. That’s why you declared the variable is it not?
what you did should work, make sure you are indexing the correct instance, make sure PlayButton is a child of script.Parent, add a WaitForChild in case it didn’t load,