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

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

Asked by 9 years ago
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

Log in to vote
1
Answered by 9 years ago

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.

0
what should be the script.parent JohnJohniamm55 21 — 9y
0
it should be game.Workspace Sorry. legospacepolice 60 — 9y
Ad

Answer this question