Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How Do I make Several Guis Dissapear At once have tried?

Asked by 9 years ago

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)

2 answers

Log in to vote
0
Answered by 9 years ago

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! :)

Ad
Log in to vote
0
Answered by 9 years ago
script.Parent.Visible = true
script.Parent.Visible = false --not ImageButton.Visible

Answer this question