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

the zindex for a gui is 101 and the other is 23 and the one with 23 is overlaying?

Asked by
MEWTLC 0
4 years ago

Ive tried setting the zindex by scripting as well as using the explorer, but it is not working. Here is the script I used: game.StarterGui.ScreenGui.Barsoutline.ZIndex=101 -- bars outline is an image label game.StarterGui.ScreenGui.Barsoutline.ImageLabel.ZIndex=23

0
is clip descendants on? misha123 83 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

When the game initializes, all the contents of StarterGui go to the PlayerGui which in the explorer is located under game.Players.playerName.PlayerGui if this is a local script, you can use this to access the PlayerGui: game.Players.LocalPlayer.PlayerGui. So emplementing that into your script:

local player = game.Players.LocalPlayer

local playerGui = player:WaitForChild("PlayerGui")

playerGui.ScreenGui.Barsoutline.ZIndex = 101
playerGui.ScreenGui.Barsoutline.ImageLabel.ZIndex = 23

Hope this fixed your problem!

0
It should also be noted that you should get the service rather than call it directly, as that is good practice + the fact that not all services load instantly on game load. Do `game:GetService("Players")` in one line, and call `LocalPlayer` in the next. Slydexic 20 — 4y
0
Using :GetService() ruins intellisense lol User#32819 0 — 4y
Ad

Answer this question