Hi, so when I die with a tool it just give me the “Cannot load the AnimationClipProvider Service” stare when I respawn
I’ve been trying to fix this error by myself for several hours now and it still does not work, I think I need a hand here…
I DID unset the player when the character died. Here’s the script
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
repeat wait() until Humanoid
local animator = Humanoid:WaitForChild("Animator")
repeat wait() until animator
local idleanim = script.Parent.Animations:WaitForChild("Idle")
local fireanim = script.Parent.Animations:WaitForChild("Fire")
local reloadanim = script.Parent.Animations:WaitForChild("Reload")
local loadidle = animator:LoadAnimation(idleanim) loadidle:Play() loadidle:Stop()
local loadfire = animator:LoadAnimation(fireanim) loadfire:Play() loadfire:Stop()
local loadreload = animator:LoadAnimation(reloadanim) loadreload:Play() loadreload:Stop()
tool.Equipped:Connect(function()
local NewGunUI = tool.GunUI:Clone()
NewGunUI.Parent = Player.PlayerGui
NewGunUI.GunName.Text = tool.Name
NewGunUI.Counter.Text = CurrentAmmo.."/"..ReserveAmmo
GunUI = NewGunUI
equipped = true
canfire = true
reloading = false
holdingfire = false
loadidle:Play(0,1,1)
end)
tool.Unequipped:Connect(function()
if GunUI then
GunUI:Destroy()
GunUI = nil
end
holdingfire = false
equipped = false
reloading = false
canfire = false
for _, animation in ipairs(allanimations) do
animation:Stop()
end
end)
Humanoid.Died:Connect(function()
if GunUI then
GunUI:Destroy()
GunUI = nil
end
holdingfire = false
equipped = false
reloading = false
canfire = false
for _, animation in ipairs(allanimations) do
animation:Stop()
end
end)
The error happens at this line
local loadidle = animator:LoadAnimation(idleanim) loadidle:Play() loadidle:Stop()
I have been experiencing the same issue for a few days now as well, I believe this would be a ROBLOX issue that they need to resolve. If you do find a way to fix it, do share! However in the meantime try to use other methods of loading an animation too.
cause I want to load them when the player spawns in so there’s no delay when loading them for the first time
It does work tho, but like I said on the topic when I respawn it returns “Cannot load the AnimationClipProvider Service” and I don’t think it’s that line’s fault
It still doesnt work. do you know what might be causing the AnimationClipProvider error in the first place? (can’t get animation, can’t get character, etc.)
if animator and idleanim then
loadidle = animator:LoadAnimation(idleanim)
elseif not animator then
print("Cant get animator")
elseif not idleanim then
print("Cant get animation")
else
print("Unknown")
end
So basically roblox just couldn’t load it for some reason because it didnt return anything but the animationclipprovider error