I added a countdown and its not working i have no clue why theres no errors the m1 still works tho
Enabled = true
local combo = 1
local countdowntime = 0
damage = 37
script.Parent.OnServerEvent:Connect(function(player,action,var)
countdowntime = 0
damage = 37 + player.SkillsFolder.Strength.Value
if Enabled == false then return end
local chr = player.Character
if action =="Attack" then
Enabled = false
if combo == 1 then
local anim = script.Slash1
local playanimation = chr.Humanoid:LoadAnimation(anim)
playanimation:Play()
combo = 2
else
local anim = script.Slash2
local playanimation = chr.Humanoid:LoadAnimation(anim)
playanimation:Play()
combo = 1
end
for i,v in pairs(workspace:GetChildren()) do
if v:FindFirstChild("HumanoidRootPart") and v:FindFirstChild("Humanoid") then
if v~= chr then
if (v.HumanoidRootPart.Position - chr.HumanoidRootPart.Position).magnitude < 7 then
v.Humanoid:TakeDamage(damage)
end
end
end
end
wait(0.8)
Enabled = true
end
end)
script.Parent.OnServerEvent:Connect(function()
repeat
wait(0.1)
countdowntime = countdowntime + 0.1
until combo == 1
end)
while true do
wait(0.025)
if countdowntime > 1 then
combo = 1
end
end

2 comments
You should not do all this code inside of a server script. If there are more than one player, both players can change the variables and it would get very glitchy.
Or just fit it all inside of the function