I have an odd feeling that this is very very simple,
here is the current code i have
PunchEvent.OnServerEvent:Connect(function(Player, HitContents, Params)
for i,v in ipairs(HitContents) do
local e_character = v.Parent
local e_humanoid = e_character:WaitForChild("Humanoid")
if e_humanoid then
if not hitlist[e_humanoid] then
hitlist[e_humanoid] = true
e_humanoid:TakeDamage(10)
hitlist[e_humanoid] = false
break
end
end
end
end)
the code has been reworked time and time again so not much is there.
I put it in a server because doing the hitbox locally causes there to be delays based on ping which Iām attempting to avoid.
If anyone could explain how I would go about damaging multiple humanoids that would be great, because currently when I click it only damages a single humanoid. Iāve researched for houuurrrssssssssssss
PunchEvent.OnServerEvent:Connect(function(Player, HitContents, Params)
local hitList = {}
for i,v in ipairs(HitContents) do
local character = v.Parent
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
if not table.find(hitList, humanoid) then
table.insert(hitList, humanoid)
humanoid:TakeDamage(10)
end
end
end
end)