How do I get a certain accesory onto a player when they first spawn in?

I have no idea what this is called because I am not a scripter…

I’m trying to make everyone that spawns into the game have a certain accessory on, in my case it is a back item (that is UGC). I’ve tried YT tutorials but they don’t work :confused: How can I do this?

1 Like
local accessoryId = 5621576440 -- Replace this id with the one you want to use

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Char)
		local Hat = game:GetService("InsertService"):LoadAsset(accessoryId)

		local accessory = Hat 
		for i,v in pairs(accessory:GetChildren()) do
			if(v.ClassName == "Accessory")then
				Char.Humanoid:AddAccessory(v) 

				break
			end
			wait()
		end
	end)
end)

-- A "Script" in Workspace, or ServerScriptService
5 Likes
local serverStorage = game:GetService("ServerStorage")
local players = game:GetService("Players")
local accessory = serverStorage.Accessory

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local hat = accessory:Clone()
		hat.Parent = character
		hat.Position = CFrame.new(x, y, z)
	end)
end)
2 Likes

This looks familiar, is this DieSoft’s script?

1 Like

I made an avatar editor before, so I just used a part of that.

You are a lifesaver, thank you so much!

1 Like

Side question, are we allowed to use a UGC item that we didn’t create in our game without permission from the creator of the item?

1 Like

I think you can, but you’d probably have to look more into that.