alright so, i am using getpartsinpart for a sword system and i have found a solution so that the damage given is not multiple and works properly. however i need it to be like when the hitbox touches multiple people, it deals damage to all of them and not to just one of them which is my current issue. the server script is below.
local Workspace = game:GetService("Workspace")
script.Parent.RemoteEvent.OnServerEvent:Connect(function(plr, combo)
print(combo)
local HRP = plr.Character.HumanoidRootPart
local hitbox = game:GetService("ReplicatedStorage").Hitbox.H1:Clone()
hitbox.Parent = workspace
hitbox.CFrame = HRP.CFrame + HRP.CFrame.LookVector * 4.5
hitbox.Transparency = 0.4
game.Debris:AddItem(hitbox, 0.5)
local params = OverlapParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params:AddToFilter(plr.Character, script.Parent.Handle)
local hit = Workspace:GetPartsInPart(hitbox, params)
local buff
for i, v in pairs(hit) do
local hum = v.Parent:FindFirstChild("Humanoid")
if hum then
if buff ~= hum.Parent.Name then
hum:TakeDamage(10)
buff = hum.Parent.Name
end
end
end
end)

** You are now Level 3! **