All of my animations only work on Studio, none of them work on Roblox servers. They always error “Failed to load animation with sanitized ID”.
They have been published more than a week ago under our Studios name.
Here is the Script:
local function playAnim(player: Player, animId: number, timeout: number?)
if timeout and timeout <= 0 then
warn(`[ANIM]: Gave up loading animation {animId} for {player.Name} after too many attempts.`)
return
end
task.spawn(function()
local ok, err = pcall(function()
task.wait(0.1)
local character = waitForFullCharacter(player, 10)
if not character then
error("Character not fully loaded.")
end
local humanoid = waitForChildOfClass(character, "Humanoid", 5) :: Humanoid
if not humanoid then
error("Humanoid not found.")
end
local hrp = character:FindFirstChild("HumanoidRootPart")
if not hrp then
error("HumanoidRootPart not found.")
end
local animateScript = character:FindFirstChild("Animate")
if animateScript then
animateScript:Destroy()
end
local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://" .. tostring(animId)
local track = animator:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
track.Looped = true
track:Play(0, 1, 1)
animator.AnimationPlayed:Connect(function(newTrack)
if newTrack.Animation then
if newTrack.Animation.AnimationId ~= anim.AnimationId then
newTrack:Stop()
end
end
end)
end)
if not ok then
warn(`[ANIM ERROR]: {err}`)
task.wait(1)
playAnim(player, animId, (timeout or 10) - 1)
end
end)
end
It’s only purpose is to start 1 Sitting animation for the player for the rest of the game. Like I said, it never works on Roblox. But I think its not the script since other animations besides the Sititng ones don’t load as well.