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

How Can You Get Into A Hat and Change the MeshId?

script.Parent.PlayerAdded:connect(function(player)
	k = game.Players.LocalPlayer
	k.Character:IsA("Hat")
	k.MeshId = "http://www.roblox.com/asset/?id=20011951"
end)

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.

2 comments

0

what should be the script.parent

0

it should be game.Workspace Sorry.

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