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

Why does my code say that 'Shirt' Isnt a valid member of player when my script checks if it exists?

I have a script that checks that if a shirt exists in my player character and then removes it but it always says that 'Shirt is not a valid member of Model "Workspace.EiOooAxea" '

Code:

if not char.Shirt then

else
	char.Shirt:Destroy()
end

1 answer

✓ Accepted answer

Use FindFirstChild()

if not char:FindFirstChild("Shirt") then

else
char.Shirt:Destroy()

end

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