• 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 Learning to make scripts..

Xapuur

New Member
Joined
Sep 15, 2009
Messages
157
Reaction score
0
Location
Chile
Hello !. I am learning to do scripts (i read the guides of the forum), and i have some questions:

1) What's a "nil" value, for what serve?
2) For what serves return, and what is it? (True and false, or 1 and 0) What's the difference if i use 1 or true?
3) In detail, for what is "cid"? Because i use this in the most of the scripts, but i don't know for what works.. Example in this function: doPlayerSetVocation(cid,voc)
4) How i can use the function getPromotedVocation(vocation) if i wanna promote a player for talkaction paying 20k?
5) Where are a guide for .lua lenguage? NOT SCRIPT OTSERVER !, lua lenguage.. :)

That's for now :)
Kind regards
Xapuur
 
Last edited:
1) nil means that nothing was returned. nil, true and false, etc. are Boolean.
2) 'return' is used just as it says, it returns something, even a nil. It can return whatever you want it to return or whatever it was scripted/programmed to return.
3) cid is Creature ID, it's a Unique ID that every creature(Monsters and Players) have. It Identifies the creature using the script.
4) too lazy to make a script :p sorry.
5) You can go to LUA.org they should have tutorials about it. I'll try to find some tutorials, but some are a little hard to understand if you are new to it.
 
Putting a "nil" value, is not the same that not put "return"?
For what i can/must/should use return?

Thanks for the page, i will see it.
 
Back
Top