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

How to use LoadAsset to give a certain player a hat every respawn?

I don't know how to use LoadAsset to give certain players hat. Can someone please explain how to do this?

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

2 comments

0

Can you fix it so that it wil work? It's very important.

0

Huh it might work you just have to try it.

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