I created this Death animation, then after many struggles managed to. Import it into Roblox Studio, Saved it, then for some reason, the animation didn't work anymore when I tried to put it back on a dummy, then I tried scripting it into replacing the death animation, but then my avatar would get stuck upward when I reset, doesn't respawn and doesn't play the animation either.
This is the Script I used:
``local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
-- Stop default ragdoll
humanoid.BreakJointsOnDeath = false
-- Load your custom death animation
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://YOUR_ANIMATION_ID" -- Replace this!
local animator = humanoid:FindFirstChildOfClass("Animator") or humanoid:WaitForChild("Animator")
local deathTrack = animator:LoadAnimation(animation)
humanoid.Died:Connect(function()
-- Freeze character pose
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") then
part.Anchored = true
end
end
-- Play the death animation
deathTrack:Play()
-- Optional: unanchor after it's done (or reset)
task.delay(deathTrack.Length + 0.5, function()
character:BreakJoints()
end)
end)``