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

Animations not playing when needed anything wrong here?

Asked by
caiggg 5
3 years ago
local function playanimation(player)
    if playerloaded.hasloaded(player) then
        pcall(function()
            local animator = player.Character.Humanoid.Animator
            local animation
            for i, v in pairs(serverstorage.Celebrations:GetChildren()) do
                for index, anim in pairs(v:GetChildren()) do
                    if anim.Name == player.leaderstats2.SelectedAnim.Value then
                        animation = anim
                        break
                    end
                end
            end
            if animation then
                animator:LoadAnimation(animation):Play()
            end
        end)
    end
end


0
When a player selects there animation it will save in leaderstats and will play when they score this is a snitbit of the code caiggg 5 — 3y
0
remove the pcall and look for errors in console memguy 161 — 3y
0
this is only a snippet this isnt just for animations caiggg 5 — 3y
0
Remove '.Animator' line 4. AProgrammR 398 — 3y

Answer this question