If I have an area filled up by a huge invisible non collidable block, how would I detect how many users are inside of that block.
EDIT
im going to use magitude to get the amount of players in a radius of 50 studs every 30 seconds
i inserted a part into workspace and placed this script inside it
while true do local list = game.Players:GetChildren() --makes a list of the current players local counter = 0 local distance = 50 ----as in 50 studs for i= 1, #list do local plyrpos = list[i].Character:WaitForChild("HumanoidRootPart").Position local centerpos = script.Parent.Position local testdistance = (plyrpos-centerpos).magnitude--- get magnitude if testdistance<=distance then counter= counter+1 ----if they are in the region then add to counter end end print("there are "..counter.." players inside") count=0 wait(30) end
here (the green part is 50 studs long). when 3 players are inside 50 stud radius it prints 3 players
here is a test with a single player inside the radius
here the blue sphere is the actual depiction of the region.