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

How do I change the walking animation?

Asked by 9 years ago

I tried this script, but it's not working. And I created the animation.

function player()
game.player.LocalPlayer.Character:waitForChild("Animate")
game.player.LocalPlayer.Character.Animate.walk.WalkAnim.AnimationId = "http://www.roblox.com/Walk-item?id=240085256"
end
game.Players.ChildAdded:connect(player)

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

You need to load it whenever the player's Character loads. With the CharacterAdded event.

This should be in workspace;

local animId = "http://www.roblox.com/Walk-item?id=240085256"

game.Players.PlayerAdded:connect(function(plr) --Player joins
    plr.CharacterAdded:connect(function(char) --Character loads
        local anim [ char:WaitForChild('Animate') --Animate
        anim.walk.WalkAnim.AnimationId = animId --Replace
    end)
end)
Ad

Answer this question