Hello. Last night I ran into an issue where a ScreenGui in StarterGui would not display after enabling it with a script. After not being able to figure out why, I tried enabling and disabling it within testing and it still didn’t work. Only when I went into the Players tab in the explorer while testing and went to my PlayerGui, I saw it in there and was able to disable and enable it from there. After deleting it from PlayerGui and trying to enable it from StarterGui it still wasnt showing up. I have a Script in ReplicatedFirst that creates another ScreenGui in the PlayerGui but I tried deleting that script and ran into the same problem. Can someone help me out? Is there a way around this or is this some sort of bug?
First of all, this topic isn’t related to Scripting Support, next time you do a topic, select the right category.
The StarterGui is basically the guis that will be put into PlayerGui on player joining, if you want to change the gui in-game on player’s screen, you have to do all changes through PlayerGui, not StarterGui.
Not sure what your issue is, essentially changing the .Enabled property on your UI?
I think your issue may be down to changing the ui in StarterGui instead of PlayerGui?
PlayerGui is the UI the player “owns” and that can be enabled on their screen.
StarterGui is a Container Class that holds UI and places them into your PlayerGui on respawn/spawn.
local ScreenGui = script.Parent -- assuming the script is in the gui
ScreenGui.Enabled = true
wait(1)
ScreenGui.Enabled = false
You need a frame… you know that right…?
Yes I do know that I need a frame. There actually happens to be a frame within the ScreenGui, believe it or not.
Don’t use StarterGui
to modify anything on your screen, it’s just there to replicate GUI Objects
The script was:
local logoGui = game.StarterGui.logoGui
logoGui.Enabled = false
wait(15)
logoGui.Enabled = true
The script was supposed to enable the logoGui within a set time to allow for another gui to delete itself before this one appeared.
Yes I have no clue how to enable/disable it through the PlayerGui
Many thanks for the info on StarterGui - PlayerGui, i was unaware
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui") -- gets the player gui
It works the same as StarterGui
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local logoGui = PlayerGui:WaitForChild("logoGui")
logoGui.Enabled = false
wait(15)
logoGui.Enabled = true
I am getting an error: attempt to index nil with ‘WaitForChild’
is this in a local script or a server script?
Yeah my bad i just realize it was in a normal script lol also that worked thank you very much!
The issue is you’re using the StarterGui one, try using the PlayerGui.