Better tou change the thread name, you are teaching how to create scripts in O.T.S not a real scripting guide.
@function
You wrote a wrong syntax, the correct syntax is:
@If...Else...Elseif...Return...End
okay i think in a big part you said correct. but in return you did a great mess -.-
Return is used to return (ohrly?) a value from a function, that you not explained correctly
Ok, where is
WHAT A BIG MESS! you are trying explai what is global and local without explain what is a variable?
@For loops
the first time i see some one explain for as first ;o but ok.
@While Loops
Are you sure? Your idea is to freeze your server?
So you will explay why to use 'break' in the loop?
@Repeat Loops
ok, where is the break?
If you really want learn LUA correctly just take a look in these links:
Lua 5.1 Reference Manual - contents
Programming in Lua : contents <-- this is better
and look to download it: luaforwindows - Installation of Lua for the Windows operating systems including many lua libraries. - Google Project Hosting
@function
You wrote a wrong syntax, the correct syntax is:
Code:
function aa(param1,param2,...)
--content
end
--or
local function aa(param1,param2,...)
--content
end
okay i think in a big part you said correct. but in return you did a great mess -.-
Return is used to return (ohrly?) a value from a function, that you not explained correctly
Code:
function plus(v1,v2)
return v1+v2
end
print(plus(10,20))
-->> print 30
@Local and Global Statements>= <= not and or
WHAT A BIG MESS! you are trying explai what is global and local without explain what is a variable?
@For loops
the first time i see some one explain for as first ;o but ok.
@While Loops
Code:
--By Evil Hero
function onUse(cid, item, fromPosition, itemEx, toPosition)
while getPlayerLevel(cid) < 50 do
doPlayerSendTextMessage(cid,22,"You are under level 50!")
end
return true
end
So you will explay why to use 'break' in the loop?
@Repeat Loops
ok, where is the break?
If you really want learn LUA correctly just take a look in these links:
Lua 5.1 Reference Manual - contents
Programming in Lua : contents <-- this is better
and look to download it: luaforwindows - Installation of Lua for the Windows operating systems including many lua libraries. - Google Project Hosting