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

my Animation dose not work with a sword works with jump how do i fix?

local player = game.Players.LocalPlayer --- this has to be in starter pack, this is a local script
local mouse = player:GetMouse()
local hum = player.Character.Humanoid
script.Parent.Activated:Connect(function()
	
	local hopethisworks = player.Character.Humanoid:LoadAnimation(script.Parent.Animation)	
hopethisworks:play()

end)

1 comment

0

Not quite sure what the question means, but it may have to do with the animation priority. Set it to action just to be sure

1 answer

✓ Accepted answer

Not sure what you're asking, please explain next time in your description. I see some possible errors inside your code.

First error:

Capitalize P in Play. Lua is case sensitive along with many other programming languages. Please note this and learn from it in the future.

Second possible error:

Your priority could be too low and the current animations defaultly playing could be overriding this.

Solution:

local player = game.Players.LocalPlayer --- this has to be in starter pack, this is a local script
local mouse = player:GetMouse()
local hum = player.Character.Humanoid
script.Parent.Activated:Connect(function()

    local hopethisworks = player.Character.Humanoid:LoadAnimation(script.Parent.Animation)  
hopethisworks.Priority = Enum.AnimationPriority.Action --Set this animation's priority to the highest.
hopethisworks:Play() --Capitalize P

end)

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