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: What does [i] mean in Lua

Previous Thread :: Next Thread 
Kilometerz is not online. Kilometerz
Joined: 20 Sep 2012
Total Posts: 2666
06 Jun 2014 04:06 PM
Sorry im new to this!
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
06 Jun 2014 04:08 PM
Well you can use brackets to index thinks and tables and instances.

Example:
local t = {"Hi"}
print(t[1])

game.Workspace could also be
game["Workspace"]

i isn't defined so it really doesn't mean anything.
Report Abuse
BaconSoap is not online. BaconSoap
Joined: 12 Sep 2010
Total Posts: 1882
06 Jun 2014 04:08 PM
That doesn't mean anything in particular. It's referring to a variable, i.

The i could mean anything.

e.g

local i = Workspace.example.Transparency
Report Abuse
7Dimensions is not online. 7Dimensions
Joined: 11 May 2014
Total Posts: 190
06 Jun 2014 04:09 PM
It is supposed to mean something?

Read about tables honestly. 'i' is just the variable they used in the 'for loop'. Also, just wanted to make sure you aren't into table manipulation for the beginning, there are way more things to see before getting into that..
Report Abuse
Quasar99 is not online. Quasar99
Joined: 21 Nov 2009
Total Posts: 9328
06 Jun 2014 04:10 PM
the most common use of i is in for loops

example:

lolMyTable = {"Roblox", "is", "pretty", "cool"}

Roblox is in the first index of the table lolMyTable

print(lolMyTable[1]) would print "Roblox" to the output

also:

for i = 0, #lolmyTable, 1 do
print(lolMyTable[i])`
end
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
06 Jun 2014 04:12 PM
^ errors

table[0] doesnt exist
Report Abuse
Quasar99 is not online. Quasar99
Joined: 21 Nov 2009
Total Posts: 9328
06 Jun 2014 04:12 PM
my bad, should be for i = 1, #lolMyTable, 1 do
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