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

On-spawn animation problem?

Asked by 9 years ago
Game.Players.PlayerAdded:connect(function(player)
    while not player.Character do wait() end
    local character=player.Character
    local animateScript=character.Animate
    animateScript.fall.FallAnim.AnimationId='http://www.roblox.com/asset/?id='
    animateScript.walk.WalkAnim.AnimationId='http://www.roblox.com/asset/?id='
end)

whenever i die, the animation script doesn't work anymore. i know there are missing id's i just don't want to put them. i don't see why it wouldn't

1 answer

Log in to vote
2
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

Well, you never set up a CharacterAdded event on the player. Also, be sure that you load the animation! So:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        local animateScript=character.Animate
        animateScript.fall.FallAnim.AnimationId='http://www.roblox.com/asset/?id='
        animateScript.walk.WalkAnim.AnimationId='http://www.roblox.com/asset/?id='
    end)
end)
0
Thank you very much! That1GuyAidan 4 — 9y
Ad

Answer this question