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

4 comments
When a player selects there animation it will save in leaderstats and will play when they score this is a snitbit of the code
remove the pcall and look for errors in console
this is only a snippet this isnt just for animations
Remove '.Animator' line 4.