• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Mining

Cosmotonio

New Member
Joined
Nov 26, 2007
Messages
142
Reaction score
0
Code to get precious stones from rock.

It is the new pick.lua file.
Code:
function getStone(cid, toPosition)
                 random_number = math.random(1,100)
                 doSendMagicEffect(toPosition,3)
                 if random_number>=95 then
    		 doCreateItem(2157, 1, toPosition)
                 elseif random_number<=94 and random_number>89 then
    		 doCreateItem(1294, 1, toPosition)
                 elseif random_number<=88 and random_number>83 then
    		 doCreateItem(1293, 1, toPosition)
                 elseif random_number<=82 and random_number>77 then
    		 doCreateItem(1295, 1, toPosition)
end
end
rocha = {386, 387, 390, 391}

function onUse(cid, item, frompos, itemEx, toPosition)
	if isInArray(rocha, itemEx.itemid) == TRUE then
		 getStone(cid, toPosition)

	elseif (itemEx.uid > 0 or itemEx.actionid > 0) and (itemEx.itemid == 354 or itemEx.itemid == 355) then
		doTransformItem(itemEx.uid, 392)
		doDecayItem(itemEx.uid)
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		return TRUE
        else 
    return 0
   end
   return 1
   end

Please tell me how to improve my code.
 
why are u doing this??

Code:
		return TRUE
        else 
    return 0
   end
   return 1
   end

just use this man

Code:
        else 
    return FALSE
   end
   return TRUE
   end
 
Mokehamer, Its same false=0 true =1

@topic
Thanks for releasing, good job!
 
Last edited:
Just use the pick if you did it like he showed you, you are only replacing the old pick script and placing that new one instead the item id stays the same for that script.
 
Back
Top