What I did was instead of how many times it occurred, I just used hit.parent and the result was the server just chose the first [Instance] and ignored the other one. for example the:
Client
[Instance(20B088D7828)] = ▼ {
[1] = Humanoid,
[2] = 5,
[3] = 1 --Times occured or leg
},
[Instance(20B088D7828)] = ▼ {
[1] = Humanoid,
[2] = 5,
[3] = 2 --Times occured or hand
},
Server
["Dummy"] = ▼ {
[1] = Humanoid,
[2] = 5,
[3] = 1 --Times occured or leg
},
That would just add multiple times since there is no debounce to check if that humanoid has been added.
Any way I just created another deb = {} and use your idea table.insert(data, {eHum, 5}) the deb = {} is to check if the humanoid has been added so it will be ignored.
sword.Touched:Connect(function(hit)
if canDamage == true then
if not hit:IsDescendantOf(character) then
local eHum = hit.Parent:FindFirstChildOfClass("Humanoid")
if eHum and not data[hit.Parent] then
data[hit.Parent] = {eHum, 5}
end
end
end
end)
You are kinda telling the server too much information. The server should just know which character the client hit.
sword.Touched:Connect(function(hit)
if canDamage == true then
if not hit:IsDescendantOf(character) then
local eHum = hit.Parent:FindFirstChildOfClass("Humanoid")
if eHum and not table.find(data, hit.Parent) then
table.insert(data, hit.Parent)
end
end
end
end)
The server should get the humanoid and do the correct damage.