Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

Try subtracting 1 from the number

Ad
Log in to vote
0
Answered by 9 years ago

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

0
I'm sure that this answered your question. aquathorn321 858 — 9y

Answer this question