I am trying to make it when I click one gui It will make others dissapear This is the one that works the script is inside this Image Button
local ImageButton = script.Parent
function onClick() if ImageButton.Visible then ImageButton.Visible = false end end
And this is what I tried
local ImageLabel = game.StarterGui.Welcome.ImageLabel
function onClick2() if ImageLabel.Visible then ImageButton.Visible = false end end
button.MouseButton1Click:connect(onClick2)
Your problem is with the definition of "local ImageLabel = game.StarterGui.Welcome.ImageLabel" If you're currently playing, you cannot change YOUR gui through StarterGUI, Starter GUI is only given to players that respawn. So to go around this problem, you would have to define the player, and then go in the playerGUI
player = game.Players.LocalPlayer local ImageLabel = player.PlayerGui.Welcome.ImageLabel
Hope this helped! :)
script.Parent.Visible = true script.Parent.Visible = false --not ImageButton.Visible