Hello!
So I created a custom accessory system for my game and it works perfectly!
Except one thing…
Whenever the player dies, their accessory is not kept on their player. Is there any fix to this?
One of my equipper’s code:
local Equip = game.ReplicatedStorage.NormalRemoteEvents.CharacterEvents.FaceAccessories.ClockworkShades
Equip.OnServerEvent:Connect(function(player)
local humanoid = player.Character:WaitForChild("Humanoid")
-- Create the Accessory.
local Accessory = Instance.new("Accessory")
Accessory.Name = "ClockworksShades"
local handle = Instance.new("Part")
handle.Name = "Handle"
handle.Size = Vector3.new(1,1.6,1)
handle.Parent = Accessory
local faceFrontAttachment = Instance.new("Attachment")
faceFrontAttachment.Name = "FaceFrontAttachment"
faceFrontAttachment.Position = Vector3.new(0,-0.24,-0.45)
faceFrontAttachment.Parent = handle
local mesh = Instance.new("SpecialMesh")
mesh.Name = "Mesh"
mesh.Scale = Vector3.new(1,1.3,1)
mesh.Offset = Vector3.new(0, -0.25, -0.15)
mesh.MeshId = "rbxassetid://1577360"
mesh.TextureId = "rbxassetid://1577349"
mesh.Parent = handle
-- Attach the Accessory to the humanoid.
humanoid:AddAccessory(Accessory)
end)
this is a ServerScript that is inside of a folder in StarterCharacter.