humanoid:LoadAnimation is deprecated, so you should load animation on the animator instead. You can create an animator by using Instance.new(“Animator”) or reference it from the humanoid: local animator = humanoid:FindFirstChildOfClass("Animator")
Well, you would need to replace humanoid:loadAnimation() with animator:LoadAnimation().
You seem to have two walk animations so I’m not too sure which one you want to incorporate or how you’re implementing your other animations.
script.Parent.Unequipped:Connect(function()
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local WalkAnim = Instance.new("Animation")
WalkAnim.AnimationId = "http://www.roblox.com/asset/?id=913402848"
if humanoid then
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
local animationTrack = animator:LoadAnimation(WalkAnim)
animationTrack:Play()
end
end
end)
script.Parent.Activated:Connect(function()
if script.Parent.Equipped and debounce == false then
debounce = true
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local action = Instance.new("Animation")
action.AnimationId = actionID
if humanoid then
local animator = humanoid.Animator
if animator then
local track = animator:LoadAnimation(action)
track:Play()
track.Stopped:Wait()
wait()
debounce = false
end
end
end
end)
What you basically need to know is that you need to utilise the Animator to load and play the animations instead. An example code snippet from the Developer API Reference:
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
local animationTrack = animator:LoadAnimation(Animation)
animationTrack:Play()
return animationTrack