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)