ZIndex is broken?
I have a TeamSelect GUI and an Intro GUI, but for some reason, the TeamSelect GUI (ZIndex 9) always appears over the top of the Intro GUI (ZIndex 10). Why is this happening?
Intro GUI:
http://puu.sh/jdnGO/10fcaa93fe.png
02 | local NameOfGame = "Roblox Prison" |
04 | local GUI = script.IntroGUI:clone() |
05 | GUI.Parent = player:WaitForChild( "PlayerGui" ) |
07 | local ThisFrame = GUI.Frame |
08 | local Text = ThisFrame.TextLabel |
09 | local ClassicLoad = ThisFrame.ClassicLoadFrame |
10 | local LoadText = ClassicLoad.LoadText |
14 | repeat wait() until player.Character |
16 | Text.TextTransparency = 1 |
17 | Text.Text = NameOfGame |
20 | while Text.TextTransparency > 0 do |
21 | Text.TextTransparency = Text.TextTransparency - . 05 |
25 | ThisFrame.Visible = false |
27 | game.Players.PlayerAdded:connect(added) |
TeamSelect GUI:
http://puu.sh/jdnJR/1e8f5eceaf.png
01 | local player = game.Players.LocalPlayer |
02 | frame = script.Parent.Frame |
05 | CivilianButtonShake = 0 |
07 | local function getTeamPlayers(teamColor) |
09 | for _, v in pairs (game.Players:getPlayers()) do |
10 | if ( not v.Neutral) and v.TeamColor = = BrickColor.new(teamColor) then |
11 | table.insert(output, player) |
17 | local function GuardJoin() |
18 | if (#getTeamPlayers( "Bright blue" )) < 15 then |
19 | if player.Neutral then |
20 | player.Neutral = false |
22 | player.TeamColor = BrickColor.new( "Bright blue" ) |
25 | if GuardButtonShake = = 0 then |
26 | frame.GuardJoin.BackgroundColor 3 = Color 3. new( 170 , 0 , 0 ) |
28 | frame.GuardJoin.BackgroundColor 3 = Color 3. new( 12 , 66 , 0 ) |
30 | frame.GuardJoin.BackgroundColor 3 = Color 3. new( 170 , 0 , 0 ) |
32 | frame.GuardJoin.BackgroundColor 3 = Color 3. new( 12 , 66 , 0 ) |
37 | local function InmateJoin() |
38 | if (#getTeamPlayers( "Medium stone gray" )) < 25 then |
39 | if player.Neutral then |
40 | player.Neutral = false |
42 | player.TeamColor = BrickColor.new( "Medium stone gray" ) |
45 | if InmateButtonShake = = 0 then |
46 | frame.InmateJoin.BackgroundColor 3 = Color 3. new( 170 , 0 , 0 ) |
48 | frame.InmateJoin.BackgroundColor 3 = Color 3. new( 12 , 66 , 0 ) |
50 | frame.InmateJoin.BackgroundColor 3 = Color 3. new( 170 , 0 , 0 ) |
52 | frame.InmateJoin.BackgroundColor 3 = Color 3. new( 12 , 66 , 0 ) |
57 | local function CivilianJoin() |
58 | if (#getTeamPlayers( "Bright orange" )) < 10 then |
59 | if player.Neutral then |
60 | player.Neutral = false |
62 | player.TeamColor = BrickColor.new( "Bright orange" ) |
65 | if CivilianButtonShake = = 0 then |
66 | frame.CivilianJoin.BackgroundColor 3 = Color 3. new( 170 , 0 , 0 ) |
68 | frame.CivilianJoin.BackgroundColor 3 = Color 3. new( 12 , 66 , 0 ) |
70 | frame.CivilianJoin.BackgroundColor 3 = Color 3. new( 170 , 0 , 0 ) |
72 | frame.CivilianJoin.BackgroundColor 3 = Color 3. new( 12 , 66 , 0 ) |
77 | frame.GuardJoin.MouseButton 1 Click:connect(GuardJoin) |
78 | frame.InmateJoin.MouseButton 1 Click:connect(InmateJoin) |
79 | frame.CivilianJoin.MouseButton 1 Click:connect(CivilianJoin) |