|
| 18 May 2014 05:47 AM |
| Is there a way to assign a player to Array B given that they are not already in Array A? |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 05:49 AM |
| Go through array A and check to see if they are in it, if they aren't, put them in array B. |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 05:53 AM |
| Unfortunately, that's what I'm confused on. How would one go through and check array A? |
|
|
| Report Abuse |
|
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 18 May 2014 05:53 AM |
arrayA = {} arrayB = {}
function checkAforPlayer(plr) for _,v in pairs(arrayA) do if plr.Name == v.Name then return true else return falseend end end
local plr = game.Players.Player1
if not checkAforPlayer(plr) then table.insert(arrayB, plr) end
|
|
|
| Report Abuse |
|
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 18 May 2014 05:53 AM |
| Whoops, need a space after 'false' |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 05:58 AM |
| I can see how this script works. Thanks. |
|
|
| Report Abuse |
|
|