So i want the code to findfirstchild of an object, IF not then, do something else.
How ever when i write this:
if workspace:FindFirstChild(v.Name).Crystal ~= nil then print('hello found') else print('hello not found') end
It just says: "Crystal is not a valid member of Model "Workspace.masonsqui34gotband"
Why is roblox ignoring my else statement? Shouldn't this just ignore the if, and go straight to the "else" because it cant findfirstchild? why is is it erroring me
try:
-- assuming v is part of a for loop eg for k,v in pairs(table) do stuff end local check = workspace:FindFirstChild(v.Name) -- make sure this is found and check it out below if (check ~= nil) and (check:findfirstchild("Crystal")~= nil) then -- if check is found and not nil then continue to find Crystal print('hello found') else if (check == nil) then print(tostring(v.Name).." not found!") print('hello not found') else print('hello not found') end end