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

verify if item is equipment

Nokturno

Not a human
Joined
Aug 7, 2009
Messages
569
Solutions
2
Reaction score
402
hello hope someone can help me with this.

im working on a crafting system atm and i need to verify if the item is gear (helmet, chest, legs, weapon, shield, etc)

what im doing right now is looping the item id of every item on the list but i do not like doing it that why.

so i want to know how can i just verify if the item is a gear piece.

this is how i am doing it.
but if i need to add more ids it is going to be a mess
Lua:
 recipe.craftedItemId == 35379 or 35380 or 35381 or 35382 or 35383
 
Could this be what you're looking for ?

Edit:
found an example on how to use it:
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.itemid == 2365 then
    local type = ItemType(target:getId())
        if type:getSlotPosition() == SLOTP_RING then
            print(1)
        else
            print(2)
        end
    end
    return true
end
 
hello hope someone can help me with this.

im working on a crafting system atm and i need to verify if the item is gear (helmet, chest, legs, weapon, shield, etc)

what im doing right now is looping the item id of every item on the list but i do not like doing it that why.

so i want to know how can i just verify if the item is a gear piece.

this is how i am doing it.
but if i need to add more ids it is going to be a mess
Lua:
 recipe.craftedItemId == 35379 or 35380 or 35381 or 35382 or 35383
If you have all the id's available, just make a big table of them.

Lua:
local craftableItems = {35379, 35380, 35381}

if table.contains(craftableItems, target.itemid) then
    -- item is craftable
end
 
Back
Top