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
 

Re: Help!

Previous Thread :: Next Thread 
SelectLOL12345 is not online. SelectLOL12345
Joined: 24 Oct 2012
Total Posts: 517
28 Jun 2015 02:54 PM
How to randomly select a child?
I want it to randomly select a spawn then I make the NPC MoveTo it.
This is a respawn script.
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
28 Jun 2015 02:57 PM
assuming they all have the same name

local allspawns = {}
local plr = NPC
b = game.Workspace:GetChildren()
for i = 1,#b do
wait()
if b[i]:IsA("SpawnLocation") then
table.insert(allspawns,b[i])
end
end

if #allspawns >= 1 then
newspawn = allspawns(math.random[1,#allspawns])
print("Selected spawn")
end

-Baheeg
Report Abuse
SelectLOL12345 is not online. SelectLOL12345
Joined: 24 Oct 2012
Total Posts: 517
28 Jun 2015 03:13 PM
I need it to randomly select a child and their Vector3 value.
Not their double.
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
28 Jun 2015 03:21 PM
Just process their Vector3 value?


-Baheeg
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