This is part of a character customization Gui.. I'm trying to make it so if a shirt and pants are both detected, then a message pops up. If it doesn't detect both, then a different one is displayed. When run, the "message1" frame shows up even if the character doesn't have a 'Shirt' or 'Pants' item on them. (The shirt and pants were completely removed when they entered, so it's not that the texture just isn't set.) Thanks!
function C()
if game.Players.LocalPlayer.Character:FindFirstChild("Shirt") and game.Players.LocalPlayer.Character:FindFirstChild("Pants")then
script.Parent.Parent.message1.Visible = true
wait(5)
script.Parent.Parent.message1.Visible = true
else
script.Parent.Parent.message.Visible = true
wait(5)
script.Parent.Parent.message.Visible = true
end
end
script.Parent.MouseButton1Click:connect(C)

2 comments
Thanks for the response! However, when I ran it, I got this error: "Players.Player.PlayerGui.customizeGui.maleinterface.Play.male:6: bad argument #1 to 'pairs' (table expected, got Object)" for line 6. Any ideas as to how to fix that? Thanks again!
Never mind, just added ":GetChildren()" after game.Players.LocalPlayer.Character. Thanks!