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

Lua Actionscript local function

BBFalcon89

Member
Joined
Jul 1, 2010
Messages
51
Reaction score
10
I've seen local functions in certain scripts around, and i understand how they work in java and whatnot i'm just not sure how they work in lua.

Must they be at the start before the main function? and the parameters inside are mine to choose as well correct?

Damn i'm making quite a few new threads a mod or somebody tell me if i should just be putting this all in one thread? And just asking new questions in that thread?
 
You can make several threads if they are about different problems/questions.

Best is to make a local function above the main function, since everything outside the main function is loaded on startup or with reload and codes inside a function are loaded every time the function is executed.
You can indeed just choose which parameters you want to add. Where you use the function, there you can add what the parameters are.
 
Thanks for the quick response!

Oh yeah i also forgot to ask, how do i call the function? because i've only seen it on creaturescripts so far and those use a return addEvent

also will this result in an increment of storageid 40104?
player:getStorageValue(40104) +1

or should i be using

player:setStorageValue(40104)+1
 
Last edited:
The last one is to set storage, the first one just gets the storage value so it returns a number.
To call the function you can just use the function as any other Lua function.
 
Back
Top