So I made a script that preloads animations, idk maybe I did it wrong but could someone explain how this works, and why it’s always failing?
local CP = game:GetService("ContentProvider")
local assets = {
"rbxassetid://5625416615",
}
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
if Character.Parent == nil then Character.AncestryChanged:Wait() end
repeat wait() until Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
function loadAnimation(contentId, Status)
local Animation = Instance.new("Animation")
Animation.AnimationId = contentId
Animation:Destroy()
local Track = Humanoid:LoadAnimation(Animation)
Track:Play()
Track:Stop()
if Status == Enum.AssetFetchStatus.Failure then
print(contentId, "Failure")
elseif Status == Enum.AssetFetchStatus.Success then
print(contentId, "Success")
end
end
CP:PreloadAsync(assets, loadAnimation)