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: