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

GUI not becomming visible?

This is supposed to change the GUI in a couple seconds but it's not working.


wait(5)

game.workspace.StarterGui.GUI1.Visible=false

game.Workspace.StarterGui.GUI2.Visible = true

.

1 comment

0

This needs to be in a local script which can't be placed in workspace and Starter Gui Is Not In Workspace And Your Only Chaning The Starter Gui Not The Player Gui :O

2 answers

StarterGui is not a child of workspace and changing the StarterGui would not change anything for anyone until they respawn. GUI elements must also be placed within a ScreenGui object. In order to change GUIs on-screen instantly, you must do this through a LocalScript, you'd have to place it in the StarterGui and set the code as:

wait(5)
player = game.Players.LocalPlayer

player.PlayerGui.ScreenGui.GUI1.Visible = false
player.PlayerGui.ScreenGui.GUI2.Visible = true

That would change the the visibility of the GUIs for the current player after 5 seconds. If you want to change the visibility for everyone at the same time you would place this code within in a script in Workspace:

wait(5)
for i, v in pairs(game.Players:GetChildren()) do
	v.PlayerGui.ScreenGui.GUI1.Visible = false
	v.PlayerGui.ScreenGui.GUI2.Visible = true
	wait()
end

Please send me a PM on Roblox if you need further help.

So players don't have StarterGuis they have PlayerGuis That being said, you can get to it by putting a LOCALSCRIPT inside the StarterGui, and get the player by doing script.parent.parent

Workspace doesn't have StarterGui in it, but game does.

I don't think the screenGui has a Visible property, the FRAME does.

So the improved script would be

make sure this is in a localscript in StarterGui

player =  script.Parent.Parent

wait(5)
player.PlayerGui.GUI1.Frame.Visible =  false
player.PlayerGui.GUI2.Frame.Visible =  true

I hope this helps

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