1268995
Member
- Joined
- Sep 9, 2010
- Messages
- 422
- Reaction score
- 13
Hello.
I am about a hour and a half trying to find a solution for this, and NOTTHING!
In this script, when player cut the tree, when the tree is cutted, it transforms to other item id.
So the tree, when cutted, become a small tree.
10 seconds after cutting the tree, the small tree MUST become a normal tree again, but its not working.
THE TREE ARE GROWING AGAIN, BUT THE SMALL TREE (id 8786) are not desappearing.
the code:
I am about a hour and a half trying to find a solution for this, and NOTTHING!
In this script, when player cut the tree, when the tree is cutted, it transforms to other item id.
So the tree, when cutted, become a small tree.
10 seconds after cutting the tree, the small tree MUST become a normal tree again, but its not working.
THE TREE ARE GROWING AGAIN, BUT THE SMALL TREE (id 8786) are not desappearing.
the code:
Code:
function onUse(cid, item, frompos, item2, topos)
local chance = 70 -- chance of cutting
local madeiras = {5941, 5901} -- item player will win
local premio = madeiras[math.random(1, #madeiras)]
local transformItem = 8786
local texts = {"Tuc", "Toc", "Trec"}
local random = texts[math.random(1,#texts)]
local time = 10 -- seconds to grown
if item2.itemid == 2708 or item2.itemid == 2700 or item2.itemid == 6218 or item2.itemid == 2701 or item2.itemid == 2707 then
doPlayerAddItem(cid,premio, math.random(1, 2))
doTransformItem(item2.uid, transformItem)
doSendMagicEffect(topos, 16)
doPlayerSendTextMessage(cid,22,"u cut a wood.")
doSendAnimatedText(topos, ""..random.."", TEXTCOLOR_GREEN)
doDecayItem(item2.uid)
addEvent(doCreateItem, time*1000, item2.itemid, 1, getThingPos(item2.uid))
return true
end
Last edited: