Spatial Query is counting player multiple times

I am trying to get all players in a Part.
Using this script:

local Players = game:GetService("Players")
local parts = workspace:GetPartBoundsInBox(obj.CFrame, obj.Size)

local playersInRound = {}

for i , part in pairs(parts) do
	local plr = Players:GetPlayerFromCharacter(part.Parent)
	
	if plr then
		print("Found Player")
	end
end

print(#playersInRound)

For some reason when I print the “Found Player” part it is printing that message several times instead of once as when testing I was the only player in the game/area.

image

I am trying to use this to add each player in the part to a table.

It looks like it’s counting the player multiple times, but it’s a different part of the character each time. You are picking up 16 parts, and each part is a part of the Character, so you are getting the player 16 times. You need to cache your results if you want to avoid that problem.