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

How do I make anims?

Asked by 9 years ago

This script changes the default anim for example I go to my place and the idle anim is different so here is the script, yes it works.

Game.Players.PlayerAdded:connect(function(player)
    while not player.Character do wait() end
    local character = player.Character
    local animateScript = character.Animate
    animateScript.idle.Animation1.AnimationId = 'http://www.roblox.com/asset/?id=80980242'
end)

And the problem is that when you reset, the anims are gone so can someone help me? Thanks.

1 answer

Log in to vote
2
Answered by 9 years ago

Use the CharacterAdded event in the player. It fires when the character is added or respawned.

Game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(char) --CharacterAdded event with an anonymous function. Char is the variable of the character.
        repeat wait() until char --Safety measure so that the character has time to properly load.
        local animateScript = char.Animate
        animateScript.idle.Animation1.AnimationId = 'http://www.roblox.com/asset/?id=80980242'
    end)
end)
Ad

Answer this question