• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Best Way To Learn Lua?

Where To Learn Lua?

  • OtLand

    Votes: 3 20.0%
  • Lua.org

    Votes: 6 40.0%
  • Other

    Votes: 6 40.0%

  • Total voters
    15

Alyhide

Banned User
Joined
Aug 21, 2010
Messages
1,945
Reaction score
54
Location
Switzerland
Hello, I am wondering the best way to learn Lua.
Should I learn it from the tutorials on OtLand?
Or learn it strait from Lua.org?

Please Give Me Answers :)
 
Just examine scripts that are posted on OtLand, and explore your libs.

It's how I learned, really.
 
I have learned from a lua book cant remeber its name now tho,which is pretty much lua.org :D

Ah ya remebered : Programming_in_Lua_2ed
 
First of all you have to understand LUA syntax and basics. Then you just have to try : D. You can make even the most stupid and useless scripts (like messages when player steps on a tile or whatever) and then try to extend them with more advanced lua structures like arrays, functions or loops.

You won't learn anything until you understand it.

Btw. LUA is really nice language! I wrote even scripts that helped me in school : P like:
Code:
function k(masa, wydluzenie)
	local t = {m = masa / 1000, x = wydluzenie / 100, g = 9.81}
	return ((t.m*t.g)/t.x)
end
local tabela = {
	[1] = {50, 9.5},
	[2] = {100, 19.5},
	[3] = {150, 29.5},
	[4] = {200, 39.5}
}
for i = 1, #tabela do
	print(i .. ": " .. k(tabela[i][1], tabela[i][2]))
end
(it's for physics - calculating spring constant)
 
Learn the LUA syntax, then start with the basics. Go through the entire lua+tfs function list and try each one that sounds useful. If you dont know how they work, look up the function on otland search and find somebody using it in another script. Once you know how what most functions do and what is possible with lua+tfs, put a couple functions togather like storages and experience, or walking on a tile and teleporting. If you really want to learn how to script, its not a simple process for someone with no programming experience and it will take a long time.
 
I have learned from a lua book cant remeber its name now tho,which is pretty much lua.org :D

Ah ya remebered : Programming_in_Lua_2ed

This is the worst and slowest way to learn. Only read if something new changes.

Other: Studing other codes.. making your own codes with pieces of other codes..

This is how I learned. Just experimenting. Fast and easy!
 
The Best Experience Is OWN EXPERIENCE
try mixing stuff or dunno maby make scripts check error on console [it almost allways says the answer] correct it do other and tada xD


SRY BAD ENGLISH IM MEXICAN :p!
 
Back
Top