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.
I am trying to use this to add each player in the part to a table.