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

How to check if an object isnt in the players gui?

Asked by 4 years ago
Edited 4 years ago

i am trying to check if an object isnt in a players gui because when the game starts there is a loading gui and when it loads it is removed and theres a script i want to run when it loads

local plrs = game.Players:GetChildren()
for i = 1, #plrs do
    if not plrs[i].PlayerGui:FindFirstChild("Loading_Gui") then
        --code
    end
end
0
You would have to use a LocalScript to access thinks inside of the PlayerGui MrLonely1221 701 — 4y
0
Yeah that's correct, a ServerScript can't look into players PlayerGui Spjureeedd 385 — 4y
0
a server script CAN look into a players player gui --->. game.Players[PlayerName].PlayerGui royaltoe 5144 — 4y

1 answer

Log in to vote
0
Answered by
TomsGames 225 Moderation Voter
4 years ago

Hi Vetrodex,

To access anything to do with PlayerGui you will need the client to run a localscript. With some more context I might be able to help you further, but for now I would recommend placing your code that you want executed in the same localscript that loads the game on the client's side.

0
a server script CAN look into a players player gui --->. game.Players[PlayerName].PlayerGui royaltoe 5144 — 4y
Ad

Answer this question