I don't know how to use LoadAsset to give certain players hat. Can someone please explain how to do this?
✓ ANSWER ACCEPTED
How to use LoadAsset to give a certain player a hat every respawn?
1 answer
✓ Accepted answer
wait(1)
plrs = {"someone","devs"}
for k,v in pairs(game.Players:GetPlayers() do
for l,t in pairs(plrs) do
if v.Name == t then
hat = game:GetService("InsertService"):LoadAsset(id) --change the id to the id you want.
for g,h in pairs(hat:GetChildren()) do
if v.ClassName == "Hat" then --The reason I did a loop because when you use LoadAsset the thing comes inside the model so I made a loop that will loop through the model and look for hats
h.Parent = v.Character
end
end --It might not work because I was lazy so I didn't do my best.
end
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Can you fix it so that it wil work? It's very important.
Huh it might work you just have to try it.