Click animation does not work

I am trying to make a sword but my script for animating the Attacks does not work unlike the video i was watching to make the script
This is the script:

local tool = script.Parent
local cooldown = script.Cooldown.Value
local animation = script.Swing



tool.Activated:Connect(function()
	local humanoid = tool.Parent:FindFirstChildWhichIsA('Humanoid')
	if humanoid and cooldown == false then
		cooldown = true
		local playanim = humanoid:LoadAnimation(animation)
		playanim:Play()
		wait (0.24)
		playanim:Stop()
		wait (0.2)
		cooldown = false
	end
end)

the video is this:

Did you make sure that the animation priority is higher than that of the core animations?

image

Core is in line with the default character animations, which can get a little weird (mixed up animations). Set your priority to idle, moement, or action.

No it seems i forgot lol thanks for helping

1 Like