Accessory not appearing

I am attempting to add an accessory onto a character however it doesn’t seem to be working, does anyone know why? The accessory object appears on the player under the explorer view but it doesn’t show on the player.

local RunService = game:GetService("RunService")

local plr = game.Players.LocalPlayer
local plrScript = plr:WaitForChild("PlayerScripts")
local plrMod = require(plrScript:WaitForChild("PlayerModule"))
local Controls = plrMod:GetControls()
local setting = plr.Character:WaitForChild("Settings")

local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Camera = workspace.Camera
local UIS = game:GetService("UserInputService")
local KeyBind = "E"
local repstor = game:GetService("ReplicatedStorage")

local selectedScene = setting.Hero.Value
local animClone = repstor.Animations[selectedScene]:Clone()
local soundClone = repstor[selectedScene]:Clone()
animClone.Parent = Character
soundClone.Parent = Character
local anim = Character:WaitForChild("Humanoid"):WaitForChild("Animator"):LoadAnimation(animClone)
local transforming = false
local outfitEv = repstor.OutfitChange


function Clothes()
	if selectedScene == "Hero" then
		wait(7.02)
		local hat = repstor.Outfits[selectedScene].Hat:Clone()
		Character.Humanoid:AddAccessory(hat)
		
		wait(1.51)
		if Character.Shirt then
			Character.Shirt:Destroy()
			local shirt = repstor.Outfits[selectedScene].Shirt:Clone()
			shirt.Parent = Character
			else return 
		end

		wait(1.06)
		if Character.Pants then
			Character.Pants:Destroy()
			local pants = repstor.Outfits[selectedScene].Pants:Clone()
			pants.Parent = Character
			else return 
		end
	end
end

function Animation()
	Controls:Disable()
	transforming = true
	soundClone:Play()
	anim:Play()

	Clothes()
	anim.Stopped:Wait()
	transforming = false
	Controls:Enable()
	outfitEv:FireServer(plr)
end

UIS.InputBegan:Connect(function(input)
	if transforming == false then
		if input.KeyCode == Enum.KeyCode[KeyBind] then
			Animation() 
		end
	else 
		return
	end
end) ```
1 Like

Nevermind, something must’ve been up with my accessory cause I changed it and it began working again.

Ah, nevermind. For some reason the accessory is not appearing on my head now. Same script I showed in the first post. Why is this happening?

Fixed it by firing a remoteserver event, apparently AddAccessory does’t work on localscript.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.