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

Check GUI if available in Inventory and Character?

First of all sorry if my English bad..btw How do i check if a GUI inside StarterGui is in player inventory using 'If'..

local sp = script.Parent --- GUI inside StarterGui
local i1 = sp.intro1 --- TextLabel

if    --- What to do?
	
print("test")    -- Example

else
	
print("Test")  -- Example

end

1 answer

If you are only checking to see if it's there at any given point of time then

if sp:FindFirstChild("ChildNameHere") then
	do something
end

If you are expecting the child soon/ want to wait for the child then

local var = sp:WaitForChild("ChildNameHere")

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