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 |
|
|
|
| 07 Jul 2015 03:43 PM |
| Make it a function and re-execute the function when you look again |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|