What i want to do is to check when a player if he or she have a Shirt or Pants
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) wait(2) if char.Pants == nil or char.Pants:IsA("Pants") then print("Pants") elseif not char.Shirt then print("No Pants") end if char.Shirt == nil or char.Pants:IsA("Shirt") then print("Shirt") elseif not char.Shirt then print("No Shirt") end end) end)
You need to wait for the pants and shirt because when the player joins the character model is made then the pants and shirt and everything else is added after so you have to wait for them.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) wait() if character:FindFirstChild("Pants") then print("pants") else print("no pants") end if character:FindFirstChild("Shirt") then print("shirt") else print("no shirt") end end) end)
Here's an updated version. I used "wait()" which pauses the script for a short amount of time to give time for the pants and shirt to be added to the character. I tested it and it should work.