Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to fix no animation play ability?

Doesn't plays animation when died/reseted.


local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Plr)
Plr.CharacterAdded:Connect(function(char)
	wait(2)
        local Hum = char:WaitForChild("Humanoid")
		Hum.BreakJointsOnDeath = false
        Hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
		local anim = Instance.new("Animation")
		anim.AnimationId = "rbxassetid://4742312546"
	    local DeathAnim = Hum:LoadAnimation(anim)

        Hum:GetPropertyChangedSignal("Health"):Connect(function()
                if Hum.Health <= 0 then
                    DeathAnim:Play()
                end
            end)

        DeathAnim.Stopped:Connect(function()
                Hum.Health = 0
                Hum:SetStateEnabled(Enum.HumanoidStateType.Dead, true)
            end)
end)
end)

animation link : https://www.roblox.com/library/4742312546/Reset

1 comment

0

Are you trying to make like a Ragdoll Animation?

1 answer

I don't think you exported the animation correctly. I searched up rbxassetid://4742312546 and nothing appeared. I also tested the script and the output said it was an invalid link. So try exporting it again.

1 comment

0

link isn't invalid, here is original link, rbxassetid:// is right input

This discussion is preserved as it was. New answers, comments, and votes are closed.