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
 

Re: Iteratively defining variables?

Previous Thread :: Next Thread 
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
01 Mar 2015 01:40 AM
What I want to do is iteratively define variables. It sounds odd at first, but essentially, I want to do something of this nature.

for i=1,10 do
var[i] = equation
end

This way, I can later operate on these variables without needing to create them all by hand.

I have a rough idea of what I want to do clearly, but I'm lost on the specifics.
Report Abuse
lego555444 is not online. lego555444
Joined: 21 Sep 2008
Total Posts: 1383
01 Mar 2015 01:50 AM
Table = {}

for i=1,10 do
table.insert(Table,your variables)
end

This is how I would retrieve em.

for i=1,10 do
Variable = Table[i]
end
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
01 Mar 2015 04:57 AM
for i=1,10 do
getfenv()[i] = equation
end
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