script.Parent.PlayerAdded:connect(function(player)
k = game.Players.LocalPlayer
k.Character:IsA("Hat")
k.MeshId = "http://www.roblox.com/asset/?id=20011951"
end)
✓ ANSWER ACCEPTED
How Can You Get Into A Hat and Change the MeshId?
1 answer
✓ Accepted answer
You're using the IsA function. This function only returns a true or false value.
If you wanted this to work you would have to do this:
script.Parent.PlayerAdded:connect(function(player)
for i,obj in pairs (game.Players.LocalPlayer.Character:GetChildren()) do
if obj.ClassName == "Hat" then
obj.Handle.Mesh.MeshId == "http://www.roblox.com/asset/?id=20011951"
end
end
end)
Make sure this runs in a local script.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
what should be the script.parent
it should be game.Workspace Sorry.