Basically, I changed my blocking a few days ago. I decided to make it work in the way that if the character was two studs away and he hit the character the damage he would take is halfed by 5. Although, the current issue is that when it loops through the folder, it keeps going for the character that is actually doing the blocking action, and not the other character that is possibly 2 studs away.
local SSS = game:GetService("ServerScriptService")
local Dic = require(SSS:WaitForChild("DictonaryHandler"))
local CTHandler = require(SSS.CombatSent:WaitForChild("CombatHandler"))
local DMG = workspace:WaitForChild("BaseDamage")
local baseDmgVal = DMG.Value
local Players = game:GetService("Players")
local Blocking = Players:GetAttribute("Blocking")
local BlockHandler = {}
function BlockHandler.OffSetDamage(Player, Enemy)
local Character = Player.Character
for _,Enemy in pairs(workspace.LivingThings:GetChildren()) do
if not Enemy == Character then
if (Enemy.HumanoidRootPart.Position-Character.HumanoidRootPart.Position).Magnitude < 2 then
print(Enemy)
print(Character)
if not Dic.find(Character, "Stunned") or Blocking == false then
CTHandler.CreateHB()
else
Enemy.Humanoid:TakeDamage(baseDmgVal/5)
end
end
end
end
end
return BlockHandler
So, I changed it from Dot, to another way of magnitude and now it won’t do anything. + Doing the block doing like this, it makes the combat a little buggy on top of it.