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
 

This might be an obvious question but.

Previous Thread :: Next Thread 
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
07 Jul 2015 03:40 PM
How can I make it so if the value is true it will look for another spawn? Somebody added a table but I'm not sure what to do with it :( I would like you to tell me what to do so I can learn this myself please.

This script is just supposed to find a different spawn for each player.

AvailableSpawns = {}
for _,spawn in pairs(gameChosenClone.Plates:GetChildren()) do
if spawn.Taken.Value == false then
table.insert(AvailableSpawns,spawn)
spawn.Taken.Value = true
elseif spawn.Taken.Value = true then
--Look again?
end

u sicko!
Report Abuse
MakerModelLua is not online. MakerModelLua
Joined: 24 Feb 2013
Total Posts: 3544
07 Jul 2015 03:43 PM
Make it a function and re-execute the function when you look again
Report Abuse
QuintinityZero is not online. QuintinityZero
Joined: 01 Oct 2008
Total Posts: 10618
07 Jul 2015 03:44 PM
AvailableSpawns = {}
for _,spawn in pairs(gameChosenClone.Plates:GetChildren()) do
if spawn.Taken.Value == false then
table.insert(AvailableSpawns,spawn)
spawn.Taken.Value = true
end
end

You don't need the elseif. The script will loop over all the spawns and fill the table with the non-taken ones.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
07 Jul 2015 03:46 PM
@Maker I've already tried that, I would still need to restart it inside of the function.
@Quintinity So if Taken is true it will already look for another spawn until it finds Taken is false?

u sicko!
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