function Combat_Handler.CreateHB(Player, Character, Humrp, sequence, Damage)
local Folder = Instance.new("Folder", workspace)
Folder.Name = Player.Name.."Combat"
Debris:AddItem(Folder, 0.25)
local Hitbox = Meshes.Hitbox:Clone()
Hitbox.CFrame = Humrp.CFrame * CFrame.new(0,0,-2)
Hitbox.Parent = Folder
local Weld = Instance.new("ManualWeld")
Weld.Part0 = Hitbox
Weld.Part1 = Humrp
Weld.C0 = Weld.Part0.CFrame:ToObjectSpace(Weld.Part1.CFrame)
Weld.Parent = Weld.Part0
local pos1 = Hitbox.Position - (Hitbox.Size/2)
local pos2 = Hitbox.Position + (Hitbox.Size/2)
local Re3 = Region3.new(pos1, pos2)
--Region3 In Action
local HBFinder = workspace:FindPartsInRegion3(Re3, Hitbox, 20)
Debris:AddItem(Hitbox, 0.3)
for i, parts in pairs (HBFinder) do
if parts.Parent:FindFirstChild("Humanoid") and parts.Parent ~= Character then
local enemyHumanoid = parts.Parent.Humanoid
enemyHumRP = parts.Parent.HumanoidRootPart
if Combat_Handler.playersincombat[Character] or DicHandler.find(Character, "Stunned") then
return
end
enemyHumanoid:TakeDamage(2.5)
local duration
if string.len(sequence) > 4 then
duration = Length * 2
else
duration = Length * 3 -- After the combo is finished make the stun a little longer
end
if not Combat_Handler.playersincombat[enemyHumanoid] then
Combat_Handler.playersincombat[enemyHumanoid] = os.clock()
Combat_Handler.playerstuntime[enemyHumanoid] = duration
DicHandler.add(enemyHumanoid, "Stunned")
enemyHumanoid.WalkSpeed = 4
enemyHumanoid.JumpPower = 0
else
Combat_Handler.playersincombat[enemyHumanoid] = os.clock()
Combat_Handler.playerstuntime[enemyHumanoid] = duration
end
end
if string.len(sequence) > 4 then
local BV = Instance.new("BodyVelocity", enemyHumRP)
BV.MaxForce = Vector3.new(22500, 22500, 22500)
Debris:AddItem(BV, 0.25)
end
break
end-- If statement ended in forloop
end
Currently I want to figure out how I would make a Block Module because it’d seem like it’d be very odd to make the Block Module work. My question is, do I split this into different smaller parts so it could specify on things purely such as damage, the actual hitbox, things like that? ( My animations are already in a separate part of this module. )