I tried to make a script that, when a player joins it takes the accessory and puts it on the player.
local player = script.Parent.Parent
local character = player.Character
wait(3)
local team = player.Team
local teamitems = team:GetChildren()
for each, i in teamitems do
local hat = i:Clone()
player.Character.Humanoid:AddAccessory(hat)
local attach = Instance.new("Weld")
attach.Name = "AccessoryWeld"
attach.Part0 = i.Handle
attach.Part1 = player.Character.Head
attach.C0 = attach.Part0.Connect.CFrame
attach.C1 = attach.Part1.CFrame
attach.Parent = attach.Part0
print(hat.Parent)
end
But rather than put the accessory on the player, it just stays in its position and doesn’t attach, how do I attach the accessory?
What you do is you name the hat “Handle” and parent the hat object to the accessory. You then make an attachment, and name it based on what attachment you want it to connect to (look up "full attachment rig …rigtype). Then after that’s done, parent it to the rig with the attachments in it. To edit its position, you just take the attachment in the hat object, activate the move tool (the attachment move tool is broken), and there ya go!
Plus, no attachment code. Just do a :Clone() and parent it!
you put the attachment in the handle, and you name it to whatever attachment you want it to stick to in the character. For something you want in the torso, you can name it something like, “WaistCenterAttachment” and move it up one stud for it to go in the perfect spot