Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Gui (lil help plz)?

How do I make a GUI invisible by default? I have the script up and running fine but I need the informatio in the about menu to only be there when I click the button and not there when the game starts up.

Player = game.Players.LocalPlayer
Menu = script.Parent
Play = Menu:WaitForChild("Play")
About = Menu:WaitForChild("About")
HasPressedPlay = false
Info = script.Parent:WaitForChild("Info")
Minimize = Info:WaitForChild("Minimize")

function MouseEnterPlayButton()
    Play.FontSize = "Size36"
    Play.Size = UDim2.new(0.45, 0, 0.160, 0)
end

function MouseLeftPlayButton()
    --166, 166, 166
    Play.FontSize = "Size24"
    Play.Size = UDim2.new(0.3, 0, 0.15, 0)
end

function MouseEnterAboutButton()
    About.FontSize = "Size36"
    About.Size = UDim2.new(0.45, 0, 0.160, 0)
end

function MouseLeftAboutButton()
    --166, 166, 166
    About.FontSize = "Size24"
    About.Size = UDim2.new(0.3, 0, 0.15, 0)
end

function PlayGame()
    if HasPressedPlay == false then
        for GuiMove = 1, 30 do
            if GuiMove <= 30 then          
                    Play.Position = Play.Position +UDim2.new(0.06, 0, 0, 0)
                end
                if GuiMove <= 20 then          
                    About.Position = About.Position +UDim2.new(0.05, 0, 0, 0)  
                end
                wait()
            end

        Menu:remove()  
    end 
end

function MinimizeInfo()
    Info.Visible = false
end

function InfoPopup()
    if Info.Visible == false then  
        Info.Visible = true
    else
        Info.Visible = false
    end
end

About.MouseButton1Down:connect(InfoPopup)
Minimize.MouseButton1Down:connect(MinimizeInfo)
Play.MouseLeave:connect(MouseLeftPlayButton)
Play.MouseEnter:connect(MouseEnterPlayButton)
About.MouseLeave:connect(MouseLeftAboutButton)
About.MouseEnter:connect(MouseEnterAboutButton)
Play.MouseButton1Down:connect(PlayGame)

4 comments

0

Set the Transparency to 1, or Visible to false. This is a really silly question.

0

I'm new to this xD, and if I set it to transparency 1 then when I click the button won't it just.. not be there

0

Script doesn't work btw

0

NEVER MIND, sorry was being dumb it worked xD

1 answer

This is quite an easy question.

Go to the Explorer tab, select the GUI item you wish to make invisible by default, then go to the Properties tab, and uncheck 'Visible'. From what your script states, it should work every time.

Comment any errors you get (if any).

~ TheArmoredReaper

:)

1 comment

0

no it worked fine, thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.