generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Region3

Previous Thread :: Next Thread 
spinywind is not online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
03 Jan 2017 01:28 AM
Tried to learn it and got the hang of it but how do i get all the players between the points?


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
03 Jan 2017 01:33 AM
local region = -- your region here
local map = -- your map here, so we can what's DEFINITELY not a player

function ScanTable(tab,val)
for k,v in next,tab do
if v == val then
return false
end
end
return true
end

function CapturePlayersInRegion(region)
local players = {}
for _,part in next,workspace:FindPartsInRegion3(region,map,math.huge) do
if part.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player and not ScanTable(players,player) then
table.insert(players,player) -- make sure we don't add the same player over and over again for multiple bodyaprts
end
end
end
print(table.concat(players))
return players
end



Report Abuse
spinywind is not online. spinywind
Joined: 26 Jan 2012
Total Posts: 3580
03 Jan 2017 01:35 AM
Thanks, got it working.


Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
03 Jan 2017 01:40 AM
Gotchu 👌


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image