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

Animation wont work?

Asked by
22To 70
9 years ago

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)

0
Yep. EzraNehemiah_TF2 3552 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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.

0
so basically your saying this should not be local and should be a regular one? 22To 70 — 9y
Ad

Answer this question