i am new to scripting ![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
add this in actions
it is easy.. but might be useful
it give 1~3 mango . the tree might die.
~~ It Respawn after 60 sec
add this in actions
Code:
function onUse(cid, item, toPosition, itemEx, fromPosition)
local place = getPlayerPosition(cid)
local chance = math.random(1,3)
local nofood = 4
local pos = getThingPos(item.uid)
if item.itemid == 5157 then
if nofood <= math.random(1,7) then
doPlayerAddItem(cid, 5097,chance)
doSendMagicEffect(place, 14)
doPlayerSendTextMessage(cid, 4, "you got "..chance.." mango")
else
if doPlayerSendTextMessage(cid, 4, "Tree Died") then
doRemoveItem(item.uid)
addEvent(doCreateItem, 60 * 1000, 5157, 1, pos)
end
end
end
end
Code:
<action itemid="5157" script="test2.lua"/>
it is easy.. but might be useful
it give 1~3 mango . the tree might die.
~~ It Respawn after 60 sec
Last edited: