2DWorlds Forums
I just discovered a feature of Lua I've never seen mentioned. - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13)
+--- Thread: I just discovered a feature of Lua I've never seen mentioned. (/showthread.php?tid=6443)



I just discovered a feature of Lua I've never seen mentioned. - Qwertygiy - 07-05-2011

[lua]
a,b,c,d,e = 1,2,3,4,5; print(a); print(b); print©; print(d); print(e)
[/lua]

Output:
1
2
3
4
5


RE: I just discovered a feature of Lua I've never seen mentioned. - sergentkyle - 07-05-2011

Cool. Even I have no Idea what that means.



RE: I just discovered a feature of Lua I've never seen mentioned. - Qwertygiy - 07-05-2011

You can set multiple variables at once.
Instead of having to go
[lua]
a = 1
b = "stringy"
c = {a, b}
[/lua]

you can go
[lua]
a,b,c = 1,"stringy",{a,b}
[/lua]

Major script size reducer.


RE: I just discovered a feature of Lua I've never seen mentioned. - Dignity - 07-05-2011

That was documented in the ROBLOX wiki somewhere....