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

Solved Loop with itemEx

rafaeru

Active Member
Joined
Mar 6, 2013
Messages
139
Solutions
10
Reaction score
30
Location
Poland
GitHub
rafaeru97
Hello, i use TFS 0.3.6 and i cant get the idea for increment action id of item by item.
The problem is itemEx is taked only on first loop on script.
Ex. I have 20 items ( this item increment action id ) in stack and 1 item with aid = 200 ( armor ) when i use 20 items in to armor i get armor with aid = 201 instead 220.

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

for i = item.type, 1, -1
do
level = itemEx.actionid
doItemSetAttribute(itemEx.uid, "aid", level+1)
end

return true
end

EDIT: SOLVED
 
Last edited:
Back
Top