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

Lua Error on make small tree desappear on this script

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:

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:
watching the code, in this part i think needed to be changed:
Code:
addEvent(doCreateItem, time*1000, item2.itemid, 1, getThingPos(item2.uid))
I think the best think to do is to put
Code:
doTransformItem(TRANSFORM SMALL PLANT WITH ITEM ID 8786 IN GROWN TREE WITH ID:8313 )

The code give i think 4 tree ids, but for now, i only whant that tree with id 8313 grow up.
 
Back
Top