• 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!

A Tutorial Proposal/Request

balador

New Member
Joined
Jan 31, 2010
Messages
23
Reaction score
0
I've posted here and there, and when I get a script it always contains all of these local functions. As I'm learning (slowly but surely). These local calls and functions start to throw me off :confused:. I've been through the tutorial section, and have read many tutorials over the past week or so. I haven't seen one that really explained the local functions. If someone could, or will be so kind to make one. I think it will benefit a lot of people. I know for sure it would benefit me greatly. As it's just me and a couple of friends that play on our server. I'm trying to make it better for anyone else that logs on, and plays.

If there's already a tutorial for this, and I have overlooked it. Please point me in the right direction, and disregard this post.
 
Actually I don't know why are we using "local" for custom functions inside a script - it won't really make a difference.

It basically became a habit for some of the scripters.

As for variables - I've been instructed that it's better to use local variables whenever possible back when I was on OtFans.

Local variable means that they'll be only available (can be called) inside the current scope.
Example:
LUA:
local a = "something"

if a then
	local a = "modified"
end

return a
This would return:
LUA:
something

Here's a good example of an online Lua debugger: http://www.lua.org/cgi-bin/demo
It only supports default Lua functions and libraries, which of course means that you shouldn't try using any OT Lua functions.
 
Ok I see. Sorry it took so long to reply. Was away from the Internet for a couple of days. Thanks for the link also. I'm going to check it out now.
 
Back
Top