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

What did I do wrong?

local Morpher = script.Parent

function onTouch(Brick)
for item, child in pairs(Brick.Parent:GetChildren())
do if child.ClassName == 'Hat' then
child.Name = "Cap"
child.Handle.Mesh.MeshId = "http://www.roblox.com/asset/?id=16190466"
child.Handle.Mesh.TextureId = "http://www.roblox.com/asset/?id=51278992"
end	
end
end
Morpher.Touched:connect(onTouch)

1 answer

Any errors? I cant see anything wrong with it. Maybe

child.ClassName == 'Hat'

Should be

child:IsA("Hat")

?

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