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

TFS 1.X+ How can i check item hasAttribute(ITEM_ATTRIBUTE_CHARGES)

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
How can i check if this item have attribute? i tried something like this, but return (hasAttribute) nil value. But i have another code with hasAttribute work fine.

Lua:
local randomic_itemsID = {1540, 1541, 1566, 1800, 9222}

function onTime(interval)
    local players = Game.getPlayers()
    for i = 1, #players do
        local player = players[i]
        local ItemGive = player:addItem(randomic_itemsID[math.random(1, #randomic_itemsID)])
        print(ItemGive:hasAttribute(ITEM_ATTRIBUTE_CHARGES))
    end
    return true
end
 
Last edited:
Back
Top