Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Welding a player's hair to their head when they die?

Asked by
Jellyfosh 125
7 years ago

I'm making a ragdoll script using the r15 model, and the only problem I've run into is that I can't seem to keep a player's hair on their head. This is the part of the script I have stored in StarterCharacterScripts that I need help with:

repeat wait() until not script.Parent:IsA("StarterCharacterScripts")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

humanoid.Died:connect(function()
    for i,v in pairs(character:GetChildren()) do 
        if v:IsA("Accessory") then 
            local handle = v.Handle
            handle.Parent = character
            handle.Name = "OldHair"
            local weld = Instance.new("ManualWeld",handle)
            weld.Name = "DeadHairWeld"
            weld.Part0 = handle
            weld.Part1 = character.Head
        end
    end
end)

The weld is created and parented to where it needs to be. There's no error.

Answer this question