I'm trying to create a check to see how many players are still in a Region3, and increases the value of a variable if there is. The variable always reports 0, even if there are players in it. Parts are detected, I just don't need them.
local partsInRegion = game.Workspace:FindPartsInRegion3(region, Reg, 1000)
local foundPlayers = 0
for i, Reg in pairs(partsInRegion) do
if Reg:FindFirstChild("Humanoid") ~= nil then
print("Found "..Reg.Parent.Name)
foundPlayers = foundPlayers + 1
end
end
print(foundPlayers.. " players found.")
if foundPlayers == 0 then
Status.Value = "There are no more players remaining!"
end
*Sorry for indentation, this is a really long script, and this is the important part.
All help is appreciated, LennyPlayzYT

2 comments
Why did you do Reg:FindFirstChild("Humanoid") if reg is a part? On line 4, reg seems to be the player. Then on line 5, it has a parent which the player.
So how do I fix the issue?