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

GUI not becomming visible?

Asked by 10 years ago

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

.

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 Anthony9960 210 — 10y

2 answers

Log in to vote
2
Answered by 10 years ago

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.

Ad
Log in to vote
1
Answered by 10 years ago

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

Answer this question