Cannot Load the AnimationClipService

I want to do a dash script but the game doesn’t stop the animation but returns the error “Cannot Load the AnimationClipService” what can I do? (I tried with another animation and loading the animation via humanoid)

local tool =  script.Parent
local Player = game:GetService("Players").LocalPlayer
local ContextActionSerice = game:GetService("ContextActionService")
local char = Player.Character
local Humrp  = char:WaitForChild("HumanoidRootPart",6)

local isAttacking =  false
local Mouse = Player:GetMouse()
local Uis = game:GetService("UserInputService")
local Debris = game:GetService("Debris")
local Hum = char:WaitForChild("Humanoid",6)
local Maxforce = Vector3.new(math.huge,math.huge,math.huge)
local amt = nil
local Cooldown = false
--local DashVelocity = Humrp.CFrame.lookVector

                  --Script--

function Attack1()
	
if Humrp.Parent.Humanoid.FloorMaterial == Enum.Material.Air or Cooldown then return end
	
	Cooldown = true
	local BV = Instance.new("BodyVelocity")
	local Anim = Instance.new("Animation")
	Anim.Parent = Hum
	local dashtime = 0.2
	Anim.AnimationId = "rbxassetid://11107911278"
	local Animator = Instance.new("Animator")
	Animator.Parent = Hum
	local Animation = Animator:LoadAnimation(Anim)
	Animation:Play()
	BV.Parent = Humrp
	BV.P = 1250
	BV.MaxForce = Maxforce
	local amt = 50
	local DashVelocity = Humrp.CFrame.lookVector*amt
	BV.Velocity = DashVelocity

	wait(dashtime)
	BV:Destroy()
	
	
	wait(dashtime/5)
	Animation:Stop()
	Animator:Destroy()
	Anim:Destroy()
	
	task.wait(2)
	Cooldown = false
end


ContextActionSerice:BindAction("Attack",Attack1,true,Enum.KeyCode.Z)

local Animator = Instance.new("Animator")
Animator.Parent = Hum

Don’t do this, Roblox already makes one for you on player characters so it would be best to do local Animator = Hum:WaitForChild("Animator"). Don’t destroy the animator at the end too because anything to do with animation relies on that, which is where the Cannot Load error comes from.

1 Like

Did you add a wait() on top of the script?

1 Like

Thanks, so already has a animator on the humanoid ?I can’t test right now but when I can i will.

I don’t think that this is the problem because the script is on a tool that you have to get, so until I pick the game already is fully loaded.

Yes, on player characters it is premade, and apparently creating a new animator and parenting it to the character’s humanoid will remove the premade one, making the new one the only animator. But in the script you have, it will destroy that new one which never replaces itself, which makes the default animate script, and anything else that relied on that character’s animation, completely error out.

1 Like