Hello everybody.
I need some change in a script that isnt working.
Here it goes:
It will have 7 Tree ids, 7 dead tree ids, and 7 wood ids
I need some change in a script that isnt working.
Here it goes:
arvores = {2700, 2701} -- Possível adicionar mais IDs.
local arvmorta = {2719, 2701} -- Possível adicionar mais IDs.
local chance = math.random(1,10)
local addID = {9805} -- Possível adicionar mais IDs.
function onUse(cid, item, frompos, item2, topos)
if isInArray(arvores, item2.itemid) then
if chance == 1 then
doPlayerAddItem(cid,addID[math.random(1,#addID)],1)
doSendMagicEffect(topos,12)
doTransformItem(item2.uid, arvmorta[math.random(1, #arvmorta)])
doPlayerSendTextMessage(cid,22,"Você cortou um pedaço de madeira!")
elseif chance == 2 then
doRemoveItem(item.uid,1)
doCreatureAddHealth(cid, -20)
doPlayerSendTextMessage(cid,22,"Seu machado quebrou e você se machucou.")
else
doPlayerSendTextMessage(cid,22,"Nada aconteceu.")
return TRUE
end
end
It will have 7 Tree ids, 7 dead tree ids, and 7 wood ids