Remote event not getting every information

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
                    },

Instead of always adding the instance to the data, are you able to just modify it to change the 3rd variable

Instead of data[hit.Parent] = {eHum, 5},

table.insert(data, {
hit = hit.Parent,
humanoid = eHum,
damage = 5,
})
2 Likes

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.

yeah the problem with this one is if the hit.Parent has the same name then the server would just recognize it as just one table.