local Rep = game:GetService("ReplicatedStorage")
local Remote = Rep.Events.Data.DataRemote
local Hat = Rep.ClownHat
local HatCopy = Hat:Clone()
local char
Remote.OnServerEvent:Connect(function(plr, msg)
if msg == "hat" then
char = plr.Character
local Hum = char:WaitForChild("Humanoid")
Hum:RemoveAccessories()
char:WaitForChild("Humanoid").Died:Connect(function()
Hum:RemoveAccessories()
end)
end
end)
I'm working on a game with pre-set characters. My goal is to get the players' hats to be removed from the player to be replaced with preset ones. This script is not working and I'm not sure why can someone please help me? Thank you for taking the time out of your day to read this.

1 comment
Use a humanoid description.