Tool animation has a load error

local tool = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local toolEvent = game.ReplicatedStorage.BearTrapEvent
-- 애니메이션 로드
local animator = character:FindFirstChildOfClass("Humanoid"):FindFirstChildOfClass("Animator")
local animation = animator:LoadAnimation(script.Animation)

tool.Equipped:Connect(function()
	animation:Play()
	humanoid.WalkSpeed = 8
end)

tool.Unequipped:Connect(function()
	animation:Stop()
	humanoid.WalkSpeed = 14
end)

tool.Activated:Connect(function() 
	humanoid.WalkSpeed = 14
	animation:Stop()
	toolEvent:FireServer(character:FindFirstChild("HumanoidRootPart"))
	tool:Destroy()
end)

At first, the animation fails to load and the error appears as shown in the attached image. It’s a local script in Tool, how do I fix it?

I’m not exactly sure how to fix this, it could just be that the AnimationClipProvider service was just loading…

Oh, I just found a solution. I just put wait(6) in the first line, and it works! :grinning:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.