wuppii
|
  |
| Joined: 20 Feb 2010 |
| Total Posts: 1625 |
|
|
| 26 Oct 2011 11:41 AM |
I am making my way into RBLX Lua and I bounced on this: 'i = 1'. Xould anyone explain what that does/means? |
|
|
| Report Abuse |
|
|
1WOOF1
|
  |
| Joined: 03 May 2009 |
| Total Posts: 20682 |
|
| |
|
wuppii
|
  |
| Joined: 20 Feb 2010 |
| Total Posts: 1625 |
|
| |
|
|
| 26 Oct 2011 01:16 PM |
it allows you to make correct syntax with [i] say you have these two codes.
p = game.Workspace:GetChildren() for i = 1, #p do
that make it so whenever you're referring to any child of workspace, it allows you to use this
p[i]
so you could do
p[i].Name = "Script" |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2011 01:20 PM |
@Venom - Don't help until you have enough experience _to_ help. Seriously, that was a TERRIBLE explanation, and by teaching people that, you're misleading them. kthx.
@OP - It depends on what you mean; your question makes no sense. Do you mean declaring a variable called i, or using a for loop with a variable called i?
-You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss- |
|
|
| Report Abuse |
|
|
ZizZazZuz
|
  |
| Joined: 16 Jun 2008 |
| Total Posts: 2743 |
|
|
| 26 Oct 2011 01:21 PM |
Either a tag or a table. Ex:
1 = 1 print(i) --Output: 1
for i = 1, 10 do print([i]) end --Prints i 10 times. Since it's a table, it returns the number in the table that it is on. |
|
|
| Report Abuse |
|
|