I have a script that is supposed to detect if a character already has hair. and then deletes that hair if a character chooses to change it. But the script errors and returns nil which makes sense because at the start if the game during character customization the character wont have any hair.
But basically how can I keep the script from running still even if it returns nil.
local hair3 = {char:FindFirstChild("MaleHair"), char:FindFirstChild("LongStraightHair")}
hair3:Destroy()
Both @imNiceBox and @E7LK should work. Basically you just do FindFirstChild cuz if there is hair then it will come back true but it should come back nil if there is no hair which can then be filtered out with a simple if statment.
Well I wasn’t talking about a type of instance, I was talking about an instance named “Hair”, if I was talking about an instance class I would’ve suggested you use FindFirstChildOfClass(). So if you know what the names of the instances will be then use my previously suggested method, else, use @LifeDigger 's method.