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

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

Asked by 4 years ago

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()
0
in front of what? Heavenlyblobmaster 271 — 4y
0
of the other GUI's Nistrict 44 — 4y
0
oh Heavenlyblobmaster 271 — 4y
0
i answered the question Heavenlyblobmaster 271 — 4y
View all comments (5 more)
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. NoahsRebels 99 — 4y
0
Yep you would change the ZIndex which is in short the render order for elements User#5423 17 — 4y
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.. Nistrict 44 — 4y
0
actually nvm Heavenlyblobmaster 271 — 4y
0
actually nvm Heavenlyblobmaster 271 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local gui = YourGui -- replace with the gui
gui.ZIndex = 10 -- or whatever the highest # is
0
its in serverscriptservice because its an intro GUI so its starts when the game starts. Nistrict 44 — 4y
0
oh Heavenlyblobmaster 271 — 4y
0
ill edit my answer Heavenlyblobmaster 271 — 4y
0
What? All the other GUI's are not in the same script. Nistrict 44 — 4y
View all comments (12 more)
0
hmm Heavenlyblobmaster 271 — 4y
0
I remember something about ZIndex but I don't remember if its useful or not? Nistrict 44 — 4y
0
wait isnt gonna do anything.. Im gonna wait for another response.. Nistrict 44 — 4y
0
but you said it yourself. Waiting isnt gonna do anythin Heavenlyblobmaster 271 — 4y
0
And Zindex might be the answer, yeah. Try to set the Zindex of the gui as high as possible.  Heavenlyblobmaster 271 — 4y
0
Im pretty sure ZIndex goes from low to high so wouldn't I set the GUI to 10? Nistrict 44 — 4y
0
ye your right Heavenlyblobmaster 271 — 4y
0
hmm... okay I will try that. Nistrict 44 — 4y
0
ZIndex is doing nothing its staying the exact same Nistrict 44 — 4y
0
it's known to be unreliable. It might work if you set the other GUI Zindex as well to lower values Heavenlyblobmaster 271 — 4y
0
so the Gui in the back is 1, the next one is 2, and all the way up to the important GUI Heavenlyblobmaster 271 — 4y
0
Did my new strat work? Heavenlyblobmaster 271 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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.

Answer this question