so i'm trying to make a taser thing that stuns people, so i created an animation for when you get stunned hit by the taser, the only problem is that when the command is given to play the animation, it only plays it for a second and then goes back to the idle animation. I have set the animation's priority to "Action" so it should be playing over everything else, here is the code for if i'm doing something wrong.
local Anim = Instance.new("Animation")
Anim.Name = "Taser"
Anim.AnimationId = "http://www.roblox.com/asset/?id=2939741656"
local LoadNewAnimation = Humanoid:LoadAnimation(Anim)
LoadNewAnimation.Priority = Enum.AnimationPriority.Action
LoadNewAnimation:Play()
sorry it's not formatted like normal code but i'm trying to paste it and only one line comes out as code so :/, excuse my noobiness
You don't have to do any of that just make it so its plays when u hit the npc u don't have to make a script that changes the Priority just a script that plays the animation and in the animation editor simply make it that priority already. ```lua
local Anim = Instance.new(“Animation”) Anim.Name = “Taser” Anim.AnimationId = “http://www.roblox.com/asset/?id=2939741656”
local LoadNewAnimation = Humanoid:LoadAnimation(Anim) LoadNewAnimation:Play() ```