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

I have a GUI that is behind all of the gamepasses and other GUI's I have. How do I move it in front?

https://gyazo.com/d180cba2995e76a0ca0d55d0a626e317

if you need to see my script that runs the GUI here.

function added(player)
	local GUI = script.IntroGui:clone()
	GUI.Parent = player:WaitForChild("PlayerGui")
end
game.Players.PlayerAdded:connect(added)
local loadt = script.Parent.comp1.loadingtext
local trabgs = script.Parent.comp1.transitionbgs
local nbgs = script.Parent.comp1.namebgs

script.Parent.comp1.Visible = true
script.Parent.topbarcover.Visible = true
nbgs.three.namelabel.Text = script.Parent.Settings.NameValue.Value
nbgs.three.namelabel.shade.Text = script.Parent.Settings.NameValue.Value

wait(1)
loadt.TextTransparency = 0.9
wait(0.05)
loadt.TextTransparency = 0.8
wait(0.05)
loadt.TextTransparency = 0.7
wait(0.05)
loadt.TextTransparency = 0.6
wait(0.05)
loadt.TextTransparency = 0.5
wait(0.05)
loadt.TextTransparency = 0.4
wait(0.05)
loadt.TextTransparency = 0.3
wait(0.05)
loadt.TextTransparency = 0.2
wait(0.05)
loadt.TextTransparency = 0.1
wait(0.05)
loadt.TextTransparency = 0
wait(4)
loadt.TextTransparency = 0.1
wait(0.05)
loadt.TextTransparency = 0.2
wait(0.05)
loadt.TextTransparency = 0.3
wait(0.05)
loadt.TextTransparency = 0.4
wait(0.05)
loadt.TextTransparency = 0.5
wait(0.05)
loadt.TextTransparency = 0.6
wait(0.05)
loadt.TextTransparency = 0.7
wait(0.05)
loadt.TextTransparency = 0.8
wait(0.05)
loadt.TextTransparency = 0.9
wait(0.05)
loadt.TextTransparency = 1
wait(1)
trabgs.one:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",0.5)
wait(0.45)
trabgs.two:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",0.5)
wait(0.45)
trabgs.three:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",0.5)
wait(0.45)
trabgs.four:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",0.5)
wait(0.45)
trabgs.five:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",0.5)
wait(0)
nbgs.one:TweenPosition(UDim2.new(0.5,-185,0.5,-60),"Out","Quad",0.7)
wait(0.45)
nbgs.two:TweenPosition(UDim2.new(0.5,-200,0.5,-75),"Out","Quad",0.7)
wait(0.45)
nbgs.three:TweenPosition(UDim2.new(0.5,-215,0.5,-90),"Out","Quad",0.7)
wait(0.45)
nbgs.three.namelabel:TweenPosition(UDim2.new(0,-5,0,-5),"Out","Quad",0.7)
wait(5)
script.Parent.comp1:TweenPosition(UDim2.new(0,0,-1,0),"In","Quad",0.7)
wait(0.7)
script.Parent:Destroy()

9 comments

0

in front of what?

0

of the other GUI's

0

oh

0

i answered the question

0

I believe there's a property in GUIs called "Zindex" which deals with what to display first, the lowest zindex GUI will display first and so on, try doing that.

0

Yep you would change the ZIndex which is in short the render order for elements

0

Ive already had my other GUI's ZIndex set to 1 and my GUI intro set to 10 and its still showing up the same..

0

actually nvm

0

actually nvm

2 answers

local gui = YourGui -- replace with the gui
gui.ZIndex = 10 -- or whatever the highest # is

16 comments

0

its in serverscriptservice because its an intro GUI so its starts when the game starts.

0

oh

0

ill edit my answer

0

What? All the other GUI's are not in the same script.

0

hmm

0

I remember something about ZIndex but I don't remember if its useful or not?

0

wait isnt gonna do anything.. Im gonna wait for another response..

0

but you said it yourself. Waiting isnt gonna do anythin

0

And Zindex might be the answer, yeah. Try to set the Zindex of the gui as high as possible. 

0

Im pretty sure ZIndex goes from low to high so wouldn't I set the GUI to 10?

0

ye your right

0

hmm... okay I will try that.

0

ZIndex is doing nothing its staying the exact same

0

it's known to be unreliable. It might work if you set the other GUI Zindex as well to lower values

0

so the Gui in the back is 1, the next one is 2, and all the way up to the important GUI

0

Did my new strat work?

Okay so I found out I could just wait for the screen GUI to be destroyed and then I could make all of the other GUI's visible its way easier than having to do ZIndex's.

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