Gui appearing when you click another gui

I have my play gui which has a transparent background, when i press play i want my main gui which has health bar etc on it, i want that to appear and the play GUI to disappear.

What would be the best solution?

3 Likes

For the best result you can tween all the elements of the play gui out, disable the gui, and enable the main gui. All of this would be in a local script. If you want, after disabling the play gui you can also destroy is using :Destroy(), but it is not necessary.

1 Like

If you want it to have function over form, you can set the visible property of everything inside the maingui to false, then do this

play.MouseButton1Click:Connect(function()
    playgui.Visible = false
    for i,v in pairs(maingui:GetChildren()) do
       v.Visible = false
    end
end

Doing this will make it so that after you click play, it will make the play gui be invisible, and make every direct child inside the main gui be visible. You will have to set the play gui’s resetonspawn to false, if you don’t want the play button to appear every time you respawn. If you wanted to make it have a smooth transition, you could use tweenservice and set either the transparency or imagetransparency of each child depending on its class.
TweenService: https://developer.roblox.com/en-us/api-reference/class/TweenService