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

Gui visible property is true but it does not show up? - Answered

So I have a script that makes a GUI visible. local block = script.Parent

while wait() do
	if script.Parent.Size.Y > 8 then
		local selectionBox = Instance.new("SelectionBox")
        selectionBox.Adornee = block
        selectionBox.Color3 = Color3.new(1,0,0)
        selectionBox.Parent = block
        local d = game.StarterGui.ScreenGui.Frame
        d.Visible = true
        wait(2)
        d.Visible = false
end
	end

The GUI was not showing up so I checked it's properties and sure enough, it was true, however it did not appear on my screen. How can I fix this? Thanks.

1 answer

✓ Accepted answer

That's because you're defining the GUI from StarterGui.

StarterGui is a service which holds GUI/LocalScript and will clone its children into player's PlayerGui when the character is loaded.

Hence, the only way to edit players' GUIs is by defining it from PlayerGui.

In your case:

local pgui = game.Players.LocalPlayer.PlayerGui

local d = pgui.ScreenGui.Frame
d.Visible = true
wait(2)
d.Visible = false

For more information : http://wiki.roblox.com/index.php?title=API:Class/PlayerGui

1 comment

0

Oh yes, I remember this now, thank you so much!

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