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

Why does this local script only load the shirt not the pants?[UNANSWERED]

Why does this only load a shirt but no pants?

script.Parent.MouseButton1Down:connect(function()

if player.Character:findFirstChild("Shirt") then
player.Character.Shirt.ShirtTemplate="http://www.roblox.com/asset/?id=202704957"
else
local s = Instance.new("Shirt", player.Character)
s.ShirtTemplate="http://www.roblox.com/asset/?id=202704957"
end

if player.Character:findFirstChild("Pants") then
player.Character.Pants.PantsTemplate="http://www.roblox.com/asset/?id=179964203"
else
local p = Instance.new("Pants", player.Character)
player.Character.Pants.PantsTemplate="http://www.roblox.com/asset/?id=179964203"
end

2 answers

When checking for pants, you used "findFirstChild". Change it to "FindFirstChild" and it should work just fine.

1 comment

0

I'm sure that this answered your question.

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