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

Animation isn't working in game. Can anyone see the problem?

I have 3 tools that use this script and only 2 of them work. The third one only works in studio.

script.Parent.Equipped:Connect(function()
	local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
	animation:Play()
	script.Parent.Unequipped:Connect(function()
		animation:Stop()
	end)
end)

5 comments

0

Did you upload the animation or get it from someone else?

0

Made it myself and uploaded it.

0

Is the animation action or what?

0

Type of animation (e.g. Action Movement), as well as whether you uploaded it on your own account or on a group game.

0

It is movement.

2 answers

Try this and see if it works

script.Parent.Equipped:Connect(function()
    local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
    animation.Priority = Enum.AnimationPriority.Action
    animation:Play()
    script.Parent.Unequipped:Connect(function()
        animation:Stop()
    end)
end)

Solved it myself. If anyone find this in the future. It is because the animation was uploaded to my profile. It was meant to be uploaded to the group.

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