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

How do you check if there is a Gui inside the PlayerGui?

I tried using this: if plyr.PlayerGui.SpeechGuiNPC01 ~= nil then

But it didn't work. I'm trying to make sure this specific Gui is not inside of the PlayerGui before it performs an action. How should I rewrite this?

1 answer

✓ Accepted answer

Your best bet would be to use FindFirstChild.

if not player.PlayerGui:FindFirstChild('SpeechGuiNPC01') then
	--// Do stuff
end;

Hope this helped.
Read more about logical operators (such as not).

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