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

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

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

3 comments

0

You would have to use a LocalScript to access thinks inside of the PlayerGui

0

Yeah that's correct, a ServerScript can't look into players PlayerGui

0

a server script CAN look into a players player gui --->. game.Players[PlayerName].PlayerGui

1 answer

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.

1 comment

0

a server script CAN look into a players player gui --->. game.Players[PlayerName].PlayerGui

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