How to fix?
if I attack when attacking dummy is attcking, attcking dummy attack is what I’m doing
if there is an attacking dummy
robloxapp-20230529-1811420.wmv (1.1 MB)
if there is no attacking dummy
robloxapp-20230529-1812036.wmv (950.7 KB)
my combat module
module.Attack = function(character,ty,weapon)
spawn(function()
local m1Attack = character.Status.Attack
m1Attack.Value = false
if character.Status:FindFirstChild("Attacking") or character.Status:FindFirstChild("Stunned") then return end
local Animationfolder = game.ReplicatedStorage.Animation.Attack:FindFirstChild(weapon)
local combo = character.Status.Combo
local ocombo = combo.Value
local Attacking = Instance.new("StringValue",character.Status)
Attacking.Name = "Attacking"
Attacking.Value = "M1"
cdata.Weapon = weapon
m1Attack.Value = true
Sprint.Stopsprint(character)
animation = character.Humanoid:LoadAnimation(Animationfolder:FindFirstChild("Attack"..combo.Value))
animation:Play()
task.wait(weapons[weapon].AttackSpeed)
if combo.Value == 1 then
cdata.m1 = 1
elseif combo.Value == 2 then
cdata.m1 = 2
end
if m1Attack.Value == true then
m1Attack.Value = false
if combo.Value == 5 then
cdata.KnockBack = 300
Hitbox.Hitbox(character,character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2.5),Vector3.new(5,5,5),true,character.HumanoidRootPart,cdata)
wait(0.05)
cdata.KnockBack = 0
Attacking:Destroy()
else
Hitbox.Hitbox(character,character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2.5),Vector3.new(5,5,5),true,character.HumanoidRootPart,cdata)
wait(0.05)
Attacking:Destroy()
end
end
print(ocombo)
if ocombo == combo.Value then
if ocombo == 1 then
combo.Value = 2
elseif ocombo == 2 then
combo.Value = 1
elseif ocombo == 5 then
combo.Value = 1
else
combo.Value = 5
end
end
wait(0.05)
cdata.m1 = 0
Attacking:Destroy()
end)
end