"Cannot load the AnimationClipProvider Service"

I am an encountering an error with my script that the script doesn’t work entirely and instead gives me the following error:

image

This is the script.

local onPlayerLoaded = function(player)
	local onCharacterLoaded = function(Char)
		local humanoid = Char:WaitForChild("Humanoid")
		local hrp = Char:WaitForChild("HumanoidRootPart")
		local anim = humanoid:LoadAnimation(incap)

		humanoid.HealthChanged:Connect(function()
			print("Health changed");
			if humanoid.Health <= 50 then
				local ClonedGui = script.Gone:Clone()
				ClonedGui.Parent = player.PlayerGui
				anim:Play()
				hrp.Anchored = true
			end;
		end);
	end;

	player.CharacterAdded:Connect(onCharacterLoaded);
	if(player.Character) then onCharacterLoaded(player.Character) end;
end;

game.Players.PlayerAdded:Connect(onPlayerLoaded);
for _, p in pairs(game:GetService("Players"):GetPlayers()) do
	onPlayerLoaded(p);
end;
2 Likes

Add a wait before trying that, it errors because the character hasn’t fully loaded before you’re trying the animations and Roblox doesn’t like that.

To even further foolproof it; have it load when the event is called and then cache it.

10 Likes