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

If itemEx = Armor, Legs, Helmet or Boots

Christopher172

New Member
Joined
Jun 16, 2016
Messages
13
Reaction score
1
Hi. I'm not really having a problem, so I do not know if I'm in the right area. If I'm not, forgive me.
I am developing a system and I will need to know if the itemEx is an armor, a legs, a helmet or a boots. I can not think of something to do this, does anyone have a hint on how to do this check?

Thanks!
 
Solution
you can just use itemType:usesSlot(slot)
where slot is one of these:
Code:
CONST_SLOT_HEAD
CONST_SLOT_NECKLACE
CONST_SLOT_BACKPACK
CONST_SLOT_ARMOR
CONST_SLOT_RIGHT
CONST_SLOT_LEFT
CONST_SLOT_LEGS
CONST_SLOT_FEET
CONST_SLOT_RING
CONST_SLOT_AMMO
You can do this easily by identifying the respective slot the items belongs to
Lua:
local itemtype = ItemType(...)
itemtype:getSlotPosition()

> https://github.com/otland/forgottenserver/wiki/Metatable:ItemType#getslotposition
Thank you for trying to help me and excuse me for ignorance.
But when I use:
Lua:
local itemtype = ItemType(2493) 
itemtype:getSlotPosition()

I get the number 56 as a return. Actually, I'm not sure how to use and how the function works. Would you help me?
 
you can just use itemType:usesSlot(slot)
where slot is one of these:
Code:
CONST_SLOT_HEAD
CONST_SLOT_NECKLACE
CONST_SLOT_BACKPACK
CONST_SLOT_ARMOR
CONST_SLOT_RIGHT
CONST_SLOT_LEFT
CONST_SLOT_LEGS
CONST_SLOT_FEET
CONST_SLOT_RING
CONST_SLOT_AMMO
 
Solution
Back
Top