How to load hats onto a character?
So recently I've been working on loading hats from the catalog to a character so they can wear it. I found a script from an old scripting helpers post and it worked. But when I tried it out in Roblox Player, it said it was broken and made me refer to this site http://devforum.roblox.com/t/coming-changes-to-insert-service/30327.
Apparently they had changed everything so that exploiters would exploit and stuff. I didn't understand what UristMcSparks was talking about in the link so I came here. Here's my script that broke.
01 | local plr = game.Players.LocalPlayer |
02 | local button = script.Parent |
04 | button.MouseButton 1 Down:Connect( function () |
05 | repeat wait() until plr.Character |
08 | local hat = game:service( "InsertService" ):LoadAsset(hatId):GetChildren() [ 1 ] |
09 | hat.Parent = plr.Character |
10 | script.Parent.Text = "Selected" |
11 | script.Parent.TextScaled = false |
12 | script.Parent.TextSize = 20 |
If anyone knows an answer please respond to me thanks :)