local sword = script.Parent
local mm = require(workspace.MainModule)
local hitbox = sword.Handle
local bossHealthType = "Humanoid"
local boss = workspace:WaitForChild("Boss")
local swingAnim = 1
local cd = 0
local char
task.spawn(function()
repeat
if cd > 0 then
cd -= .1
end
task.wait(.1)
until false
end)
sword.Equipped:Connect(function(mouse)
char = sword.Parent
end)
sword.Activated:Connect(function()
print(cd)
if cd == 0 then
cd = .3
if swingAnim == 1 then
swingAnim = 2
mm.PlayAnim(char.Humanoid, 118629266337390, "SwordSwing1")
else
swingAnim = 1
mm.PlayAnim(char.Humanoid, 94428166254459, "SwordSwing2")
end
end
end)
in the activated event i have a print function that prints the current cooldown of the swing. for the first print it prints 0, as expected. anytime i try it afterwards, however, it somehow becomes a gigantic negative number??