Hello.
I try use function fromPosition when use a ID, create item fromPosition (apples)
But items create in the same stackpos (Plum Tree - stackpos = 1 , create apples the same stackpos = 1).
I cant eat apples on tree becouse when I use the same ID fromPosition, my script autmaticaly work.
BTW. Click on Plum Tree > poof and create apples on fromPosition, next I click on apples (eat) - not work, again creating next apples.
I need script - Click on Plum Tree, create apples on the same position and click again (eat apple) - no have aplles on the same position, again create a apples when click on plum tree.
This is my script. Work, create apples on tree but i can't eat.
I try use function fromPosition when use a ID, create item fromPosition (apples)
But items create in the same stackpos (Plum Tree - stackpos = 1 , create apples the same stackpos = 1).
I cant eat apples on tree becouse when I use the same ID fromPosition, my script autmaticaly work.
BTW. Click on Plum Tree > poof and create apples on fromPosition, next I click on apples (eat) - not work, again creating next apples.
I need script - Click on Plum Tree, create apples on the same position and click again (eat apple) - no have aplles on the same position, again create a apples when click on plum tree.
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2703 then
doCreateItem(2764, math.random(1, 3), fromPosition)
return true
end
This is my script. Work, create apples on tree but i can't eat.