Need help making if FindFirstChild successful then

im wondering how to go about making an ‘if then’ statement where if the FindFirstChild inside of the statement finds what it’s looking for, it will continue

I’m not sure what you’re looking for as it already does this, If FindFirstChild doesnt find what its looking for, it returns nil, which is why you do:

if Example:FindFirstChild("Example") then -- Fires if found 

this is pretty much saying: if Example is not nil

if you want the opposite, use not, or else

if not Example:FindFirstChild("Example") then -- Fires if not Found
if Example:FindFirstChild("Example") then
   -- code
else -- if not found
   -- also code

in functions or loops you can do the same:

-- exits function with Data (no data returned)
if Example:FindFirstChild("Example") then return end 
-- Skips Current Iteration (Ex: if you are on step 5, Skip to step 6!)
if Example:FindFirstChild("Example") then continue end
-- Exits loop
if Example:FindFirstChild("Example") then break end 

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.