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

Shirt isn't a valid member of a model?

Asked by 9 years ago

I have the error : Shirt isn't a valid member of an model.

wait(3)
Player = script.Parent.Parent.Parent
c = Player.Character
n = script.Parent
mouse = Player:GetMouse()

function hit(mouse)
    c["Shirt"].ShirtTemplate = "http://www.roblox.com/asset/?id=17527206"
    c.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=165863810"
end

function onSelected(mouse)
    mouse.Button1Down:connect(function() hit(mouse) end)
end

n.Selected:connect(onSelected)


I tried this too

c.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=17527206"

But it gave me the same error.Any help?

0
Give the actual output and we can help better. FearMeIAmLag 1161 — 9y
0
See if the shirt is VALID, some people don't wear shirts because they buy hats and etc. EzraNehemiah_TF2 3552 — 9y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago
if not c:FindFirstChild("Shirt") then

end

Checks if the shirt is there or not

Ad

Answer this question