Animation Playing Error

trying to load in an attack animation for a tool, got this error:
Cannot load the AnimationClipProvider Service.

the script:

local modules = sss:WaitForChild("Modules")
local attackmod = require(modules:WaitForChild("Attack"))

local tool = script.Parent
local plr = tool.Parent.Parent
local character = plr.Character or plr.CharacterAdded:Wait()

local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local attackAnim = animator:LoadAnimation(script:WaitForChild("SlapAnimation"))

local attackData = {
	Damage = 5,
	StartUp = 0.2,
	Knockback = Vector2.new(50,20),
	Stun = 2,
	Linger = 0.4
}

local cooldown = 1
local debounce = false

tool.Activated:Connect(function()
	if debounce then return end
	debounce = true
	attackAnim:Play()
	attackmod.Start(character, tool, attackData)
	task.wait(cooldown)
	debounce = false
end)

the error line: local attackAnim = animator:LoadAnimation(script:WaitForChild(“SlapAnimation”))

1 Like

The object your loading in an animation for might have to be in workspace

1 Like