When using .Touched, it repeats the damage so if anyone has a solution for this it would be great thanks!
function M1Dmg(toucher)
if toucher.Parent:IsA(PlayersHitWithM1) then
return
else
print("continue")
table.insert(PlayersHitWithM1, toucher.Parent)
toucher.Parent.Humanoid:TakeDamage(Configs["Damage"])
end
end
function M1Dmg(Hit)
if (not PlayersHitWithM1[Hit.Parent.Name]) then
PlayersHitWithM1[#PlayersHitWithM1+1] = Hit.Parent.Name
Hit.Parent.Humanoid:TakeDamage(Configs["Damage"])
end
end
Scratch off what i said before, the problem is still relevant. I added a print to detect when damage is dealt and It fired multiple times when hiting something.
I assume you are using .Touched for this, This isnt the best way, Although im not sure how to solve your problem. like @Bovious said, You should use Muchacho hitbox, It uses spatial queries, and its really good.