Script:
PHP:
----- Woodkepper Sistem By Runando -----
function onUse(cid, item, frompos, item2, topos)
local woodend = getGlobalStorageValue(10001)
local woodbegin = getGlobalStorageValue(10002)
local rand = math.random(1, 15)
if item2.itemid == 2705 then
if getPlayerExhaust(cid,2553,2386) == 1 then
if getGlobalStorageValue(10001) < 2 then
if rand == 1 then
doSendAnimatedText(topos,'Paackk',200)
doPlayerAddItem(cid,5901,1)
doPlayerSendTextMessage(cid,22,msgfound)
setGlobalStorageValue(10001, woodend+1)
elseif rand >= 2 and rand <= 15 then
doSendAnimatedText(topos,'Peeckk',240)
doSendMagicEffect(topos,3)
end
else
doSendMagicEffect(topos,3)
doSendAnimatedText(topos,'KRECCKK',250)
doTransformItem(item2.uid,6431)
setGlobalStorageValue(10002, woodbegin+1)
end
else
doPlayerSendCancel(cid,"Você esta exausto, espere um pouco.")
end
elseif item2.itemid == 6431 then
if getGlobalStorageValue(10002) == 0 then
doPlayerSendCancel(cid,"A arvore esta quebrada, espere um pouco para crescer.")
doTransformItem(item2.uid, 2705)
doCreateItem(2705, 3, topos)
doDecayItem(item2.uid)
setGlobalStorageValue(10002, woodbegin-1)
setGlobalStorageValue(10001, woodend-3)
return 1
else
doPlayerSendCancel(cid,"A arvore esta quebrada, espere um pouco para crescer.")
end
end
end
Don't work!