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

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

Asked by 5 years ago

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)
0
Did you upload the animation or get it from someone else? 174gb 290 — 5y
0
Made it myself and uploaded it. IcyBlazeRB 28 — 5y
0
Is the animation action or what? FixRobloxz 61 — 5y
0
Type of animation (e.g. Action Movement), as well as whether you uploaded it on your own account or on a group game. BuDeep 214 — 5y
0
It is movement. IcyBlazeRB 28 — 5y

2 answers

Log in to vote
0
Answered by
sheepposu 561 Moderation Voter
5 years ago

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)
Ad
Log in to vote
0
Answered by 5 years ago

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.

Answer this question