Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Animation wont work?

Wont run and i placed as a local script in starterpack and yes i did make and publish the animation. But it wont work when i join the game

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        local script = game.StarterPack.LocalScript
        if character:FindFirstChild("Humanoid") then
            local animation = Instance.new("Animation")
            animation.AnimationId = "http://www.roblox.com/Asset?ID=222080965"
            local animtrack = character.Humanoid:LoadAnimation(animation)
            animtrack:play()
        end
    end)
end)

1 comment

0

Yep.

1 answer

✓ Accepted answer

LocalScripts can use the PlayerAdded functions, therefore it cannot use the CharacterAdded event and it cannot reach the humanoid to load the animation and play it.

1 comment

0

so basically your saying this should not be local and should be a regular one?

This discussion is preserved as it was. New answers, comments, and votes are closed.