AddAccessory just makes the accessory spawn on the ground

Trying to make a hat attach to the player but it just clones to where it is in ServerStorage and falls onto the ground

Not really sure why this is happening since im 99% sure the script is correct

local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local SS = game:GetService("ServerStorage")

local RemoteEvent = RS.ClientEvents.hattestRE
local Hat = SS["hat test"]

RemoteEvent.OnServerEvent:Connect(function(Player, isEquipped)
	local Char = Player.Character or Player.CharacterAdded:Wait()
	local Hum = Char:WaitForChild("Humanoid")
	if isEquipped == true then
		local newHat = Hat:Clone()
		Hum:AddAccessory(newHat)
	else
		local newHat = Char:FindFirstChild("hat test")
		newHat:Destroy()
	end
end)

you could clone the hat and weld it to the player’s head

That just does the same thing as AddAccessory

1 Like