I Was working on custom hats for my game and I have noticed an issue in a script (or generally in roblox studio) that when a player equips a hat it will just float above his head.
When I Used the same script that gives you the hat, everything worked just perfectly fine
Script I used:
local vest = script.Parent
local handle = vest.Handle
script.Parent.Activated:Connect(function()
local char = script.Parent.Parent
local h = script.Parent.Parent.Humanoid
game.ReplicatedStorage.VestMesh.Parent = char
h:LoadAnimation(script.Parent.Animation):play()
h.MaxHealth = 150
h.Health = 150
script.Parent:Clone()
script.Parent:Destroy()
end)
I have tried making the character’s parts not colideable but it didn’t change anything
local vest = script.Parent
local handle = vest.Handle
script.Parent.Activated:Connect(function()
local char = script.Parent.Parent
local h = script.Parent.Parent.Humanoid
game.ReplicatedStorage.VestMesh.Parent = char.Torso.BodyFrontAttachment
h:LoadAnimation(script.Parent.Animation):play()
h.MaxHealth = 150
h.Health = 150
script.Parent:Clone()
script.Parent:Destroy()
end)
You seem to have parented the accessory to the character, not at the proper attachment, does this work?
The Humanoid’s Torso also has that attachments, which names should match the accessory’s attachment. Roblox will take care of it automatically, as long as these names match. Also, don’t forget to make the accessory unanchored so it doesn’t lock the player.