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

Why wont this walking animaton work>?

Asked by 8 years ago

I want the animation to play when you walk, but it isnt working

Blue squiggly line under humanoid on line 6

local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=########"

game.Workspace.Player.Humanoid.Running:connect(function(speed)
    if speed == 16 then
        local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()
end
end)

1 answer

Log in to vote
1
Answered by 8 years ago

Put this in a localscript inside StarterGear:

wait(1)
local AnimationId = "http://www.roblox.com/Asset?ID=########"
local Player = game.Players.LocalPlayer
local Character = Player.Character

Character:WaitForChild("Animate").walk.WalkAnim.AnimationId = AnimationId
Ad

Answer this question