game.ReplicatedStorage.RemoteEvents.CharacterCustomize.Hair.hair1.OnServerEvent:Connect(function(plr)
local storage = game.ReplicatedStorage.Hair
local char = plr.Character
if char:FindFirstChild("Humanoid") then
local folder = char.Head.HairStorage
folder:ClearAllChildren()
local new_hair = storage.Hair1:Clone()
new_hair.Parent = char
local head = char.Head
char.Humanoid:AddAccessory(new_hair)
end
end)
The remote event and rest of the script works fine, but when I run it, it simply refuses giving me the error showed in the post’s title. I’m not sure why it’s giving me that, since the accessory is stored in ReplicatedStorage and not a humanoid. Anyone can help?
Before using :AddAccessory you’re parenting the accessory to the character. It doesn’t know it’s the same character so it’s assuming it’s “another character”. Remove that new_hair.Parent = char line, you’re already using :AddAccessory anyways.
I removed the line and the script “works”, but it’s now adding and immediatly removing the accessory. I’m not sure if it’s affiliated with remote events…?