• 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 [Class] Parameters

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I teach class parameters
Parameters

are parameters:thumbup:

In this lesson we will learn to serve as the parameters used we see after the functions. Pametros are used to denote the actions that will make the functions (location, item, player ...), with them we "create destinations" for the functions.

Code:
onUse function (cid, item, frompos, item2, topos)

Meaning of Parameters

First let's understand what they are and what they are. Translating the moon for Portuguese (if I may say so):

cid: Creature ID means, ie, the id of the player. (player that makes action)
item: item would be the same, but that was used by the person for the same.
frompos: means "position", ie position of the item used.
item2: it would be when using the item on another item, or to another person. (runes for example)
topos: means "to position", ie the position where the item was used.

-----------------------------------------------

Using Parameters

Now let's see an example of functions with these parameters and how to use them.

Code:
isPlayer(cid)


In this example the function ISPLAY (cid) is directed to the cid parameter, ie, the function will check if those who made the action is a player.

Code:
doSendMagicEffect (topos, 2)
and
doSendMagicEffect (frompos, 2)

In this role we use the frompos tops and indicate the place where will happen to açã
Code:
doRemoveItem (cid, n)
and
doRemoveItem (item2.uid, n)

n as we have only one variable, the item indicates that the action will remove the one item that is local, meaning you use it and gives it the action will take place in that local action. item2 and indicates that the action will remove the item from the location that you give "use with" and "use", ie, 2 ° person.

Okay, now do not disturb it!:thumbup:
 
Last edited:
it would be nice if there was more tutorials like this about function parameters. For example for me, newbie to LUA and tibia functions. This post was that i was looking for. Ty.
 
Poor tutorial :)
And why the fuck this 'class' in thread name? :O
 
Back
Top