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

Cut Trees

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
imagemds3.jpg


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!
 
Try this one.
Code:
----- 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)
        else    
            doPlayerSendCancel(cid,"A arvore esta quebrada, espere um pouco para crescer.")
        end
    end
return TRUE
end
 
I have edited the script, look:
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 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
    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)
        else    
            doPlayerSendCancel(cid,"A arvore esta quebrada, espere um pouco para crescer.")
        end
    end
return TRUE
end

Error:
imagemyo1.jpg
 
Last edited:
Code:
doPlayerSendTextMessage(cid,22,msgfound)

I dont see local msgfound = "txt" anywhere. :confused:

You should declare it.
 
Back
Top