Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Hi i wanna ask if i can Check if object exist ???? blah blah blah

Asked by 3 years ago

blah blah blah blah blah blah

0
pwease help DefinitelyNotTronix 19 — 3y

1 answer

Log in to vote
0
Answered by
VitroxVox 884 Moderation Voter
3 years ago
Edited 3 years ago

Hello! Yes of course you can and the way you achieve this is by using FindFirstChild

Example :

local part_to_find = workspace:FindFirstChild("part_name")
if part_to_find then
    print("found")
  else
    print("not found")
end

This function of instance returns NIL (false) if the instance you specified isn't found and returns TRUE if found.

Of course if the object doesn't exists it will return NIL (false) as it can't find it. If it does however exists then it returns TRUE as it can find it.

Ad

Answer this question