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 » Scripting Helpers
Home Search
 

Re: Assigning Players to Unique Arrays

Previous Thread :: Next Thread 
radioactivated is not online. radioactivated
Joined: 05 Sep 2009
Total Posts: 1181
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
radioactivated is not online. radioactivated
Joined: 05 Sep 2009
Total Posts: 1181
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 is not online. 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 is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
18 May 2014 05:53 AM
Whoops, need a space after 'false'
Report Abuse
radioactivated is not online. radioactivated
Joined: 05 Sep 2009
Total Posts: 1181
18 May 2014 05:58 AM
I can see how this script works. Thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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