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: How do I return into a table?

Previous Thread :: Next Thread 
QuadFactor is not online. QuadFactor
Joined: 19 Apr 2011
Total Posts: 333
27 Jun 2013 01:14 PM
function findPlayer(arg)
local goodplayers = {}
players = game.Players:getPlayers()
for i = 1, #players do
if players[i].TeamColor ~= arg then
table.insert(goodplayers,players[i])
end
return goodplayers
end

Would this work if
table = findPlayer(BrickColor.new(69)?
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
27 Jun 2013 01:18 PM
Open View>Output to see bugs


table = findPlayer(BrickColor.new(69)) -- this was missing a bracket, and may have returned an error.
print(table) -- to prove or disprove your theory.
Report Abuse
QuadFactor is not online. QuadFactor
Joined: 19 Apr 2011
Total Posts: 333
27 Jun 2013 01:27 PM
Thanks, the only problem is that this is just a segment of something which hasn't been coded yet, so I'm not able to replicate parameters ect.
Report Abuse
QuadFactor is not online. QuadFactor
Joined: 19 Apr 2011
Total Posts: 333
27 Jun 2013 01:28 PM
The main thing is that you can return a table.
Is it possible?
Report Abuse
RoAnt is not online. RoAnt
Joined: 14 Jul 2008
Total Posts: 16794
27 Jun 2013 01:34 PM
Yes, table can be return but it will return as a... hexadecimal?
I forgot but it would look like this:

table: 0x9d9bb0


I tested this:

function tab()
loltable = {"lol"}
return loltable
end

print(tab())
Report Abuse
QuadFactor is not online. QuadFactor
Joined: 19 Apr 2011
Total Posts: 333
27 Jun 2013 01:40 PM
I don't think you can print tables. Let me try printing the contents of it.
Report Abuse
QuadFactor is not online. QuadFactor
Joined: 19 Apr 2011
Total Posts: 333
27 Jun 2013 01:41 PM
I tested this:

function tab()
loltable = {"lol"}
return loltable
end

print(table.concat(tab()))

and it seems to work. Thanks for the support guys.
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