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

Digging carrots!

ToloXXX

New Member
Joined
Dec 14, 2014
Messages
93
Reaction score
4
Any one have any idea how to make a script where i can use a shovel in a certian dirt and you have chance to get a carrot or a monster would pop up? 0.3.6 client 8.60
 
Normally I'd ask for your shovel script..
Normally I'd also ask if you need an ActionID on the tile..
Normally I'd wait..
But today my good sir, I'm not going to create a script.
Today, my good sir, I'm going to give you a small piece of code that will work.
Today, you could have a script that works, but only if you use the small peices of information that I have provided for you.
Today you get to solve your very own puzzle.

Today you get to see how annoyed I get when people don't give enough information to do their requests.

Today, I want you to look at the first two lines I wrote.
They will be the 100% require clues to finish your request.
Lua:
local rand = math.random(2)
if rand == 1 then
   doPlayerAddItem(cid, 2684, 1, true)
else
   doCreateMonster("rabbit", toPosition)
end
 
incase you like 1 liners.
Lua:
return math.random(2) == 1 and doPlayerAddItem(cid, 2684, 1, true) or doCreateMonster("rabbit", toPosition)
 
Normally I'd ask for your shovel script..
Normally I'd also ask if you need an ActionID on the tile..
Normally I'd wait..
But today my good sir, I'm not going to create a script.
Today, my good sir, I'm going to give you a small piece of code that will work.
Today, you could have a script that works, but only if you use the small peices of information that I have provided for you.
Today you get to solve your very own puzzle.

Today you get to see how annoyed I get when people don't give enough information to do their requests.

Today, I want you to look at the first two lines I wrote.
They will be the 100% require clues to finish your request.
Lua:
local rand = math.random(2)
if rand == 1 then
   doPlayerAddItem(cid, 2684, 1, true)
else
   doCreateMonster("rabbit", toPosition)
end

How about tomorrow?
 
How about tomorrow?
A good comeback. :p

I'm not singling you out.
It's just frustrating seeing a lot of threads without the proper information.

On that note though..
Today, I want you to look at the first two lines I wrote.
They will be the 100% require clues to finish your request.
Normally I'd ask for your shovel script..
Normally I'd also ask if you need an ActionID on the tile..
 
A good comeback. :p

I'm not singling you out.
It's just frustrating seeing a lot of threads without the proper information.

On that note though..


Its a laugh :p

Yeah you can put what ever action id dont have one. I was just wondering if its possible.

Shovel script is :

Lua:
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(isInArray(holes, itemEx.itemid)) then
        local newId = itemEx.itemid + 1
        if(itemEx.itemid == 8579) then
            newId = 8585
        end

        doTransformItem(itemEx.uid, newId)
        doDecayItem(itemEx.uid)
    elseif(isInArray(sand, itemEx.itemid)) then
        local rand = math.random(1, 10000)
        if(itemEx.actionid  == 100 and rand <= 2) then
            doTransformItem(itemEx.uid, 489)
            doDecayItem(itemEx.uid)
        elseif(rand <= 1000) then
            doCreateItem(2152, 1, toPosition)
        elseif(rand <= 2000) then
            doCreateMonster("Scarab", toPosition, false)
        elseif(rand <= 200) then
            doCreateMonster("Ancient Scarab", toPosition, false)
        elseif(rand <= 100) then
            doCreateMonster("Ancient Mummy", toPosition, false)
        elseif(rand <= 40) then
            doCreateMonster("Desert Scorpion", toPosition, false)
        elseif(rand <= 10) then
            doCreateMonster("Pro Banshee", toPosition, false)
        end

        doSendMagicEffect(toPosition, CONST_ME_POFF)
    end

    return true
end
 
Last edited:
Why don't you make the script yourself? Just take first scarab coin / scarab digging script, change item and monster, then associate it with ground ID. Simple, isn't it? In case only specific tiles should work this way, adda a check for actionID (and assign the action ID on your map of course)
 
Why don't you make the script yourself? Just take first scarab coin / scarab digging script, change item and monster, then associate it with ground ID. Simple, isn't it? In case only specific tiles should work this way, adda a check for actionID (and assign the action ID on your map of course)

Isn't this what the request forum is for? See if anyone can give a hand. If not I wouldn't ask. But its much appreciated!
 
Its a laugh :p

Yeah you can put what ever action id dont have one. I was just wondering if its possible.

Shovel script is :

--lua
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray(holes, itemEx.itemid)) then
local newId = itemEx.itemid + 1
if(itemEx.itemid == 8579) then
newId = 8585
end

doTransformItem(itemEx.uid, newId)
doDecayItem(itemEx.uid)
elseif(isInArray(sand, itemEx.itemid)) then
local rand = math.random(1, 10000)
if(itemEx.actionid == 100 and rand <= 2) then
doTransformItem(itemEx.uid, 489)
doDecayItem(itemEx.uid)
elseif(rand <= 1000) then
doCreateItem(2152, 1, toPosition)
elseif(rand <= 2000) then
doCreateMonster("Scarab", toPosition, false)
elseif(rand <= 200) then
doCreateMonster("Ancient Scarab", toPosition, false)
elseif(rand <= 100) then
doCreateMonster("Ancient Mummy", toPosition, false)
elseif(rand <= 40) then
doCreateMonster("Desert Scorpion", toPosition, false)
elseif(rand <= 10) then
doCreateMonster("Pro Banshee", toPosition, false)
end

doSendMagicEffect(toPosition, CONST_ME_POFF)
end

return true
end
--lua

Please read the rules; Rules for the Support board
How to display CODE properly in your post
 
Its a laugh :p

Yeah you can put what ever action id dont have one. I was just wondering if its possible.

Shovel script is :

Lua:
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(isInArray(holes, itemEx.itemid)) then
        local newId = itemEx.itemid + 1
        if(itemEx.itemid == 8579) then
            newId = 8585
        end

        doTransformItem(itemEx.uid, newId)
        doDecayItem(itemEx.uid)
    elseif(isInArray(sand, itemEx.itemid)) then
        local rand = math.random(1, 10000)
        if(itemEx.actionid  == 100 and rand <= 2) then
            doTransformItem(itemEx.uid, 489)
            doDecayItem(itemEx.uid)
        elseif(rand <= 1000) then
            doCreateItem(2152, 1, toPosition)
        elseif(rand <= 2000) then
            doCreateMonster("Scarab", toPosition, false)
        elseif(rand <= 200) then
            doCreateMonster("Ancient Scarab", toPosition, false)
        elseif(rand <= 100) then
            doCreateMonster("Ancient Mummy", toPosition, false)
        elseif(rand <= 40) then
            doCreateMonster("Desert Scorpion", toPosition, false)
        elseif(rand <= 10) then
            doCreateMonster("Pro Banshee", toPosition, false)
        end

        doSendMagicEffect(toPosition, CONST_ME_POFF)
    end

    return true
end
Lua:
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}
local carrot_dirt = {103}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(isInArray(holes, itemEx.itemid)) then
       local newId = itemEx.itemid + 1
       if(itemEx.itemid == 8579) then
           newId = 8585
       end

       doTransformItem(itemEx.uid, newId)
       doDecayItem(itemEx.uid)
   elseif(isInArray(sand, itemEx.itemid)) then
       local rand = math.random(1, 10000)
       if(itemEx.actionid  == 100 and rand <= 2) then
           doTransformItem(itemEx.uid, 489)
           doDecayItem(itemEx.uid)
       elseif(rand <= 1000) then
           doCreateItem(2152, 1, toPosition)
       elseif(rand <= 2000) then
           doCreateMonster("Scarab", toPosition, false)
       elseif(rand <= 200) then
           doCreateMonster("Ancient Scarab", toPosition, false)
       elseif(rand <= 100) then
           doCreateMonster("Ancient Mummy", toPosition, false)
       elseif(rand <= 40) then
           doCreateMonster("Desert Scorpion", toPosition, false)
       elseif(rand <= 10) then
           doCreateMonster("Pro Banshee", toPosition, false)
       end

       doSendMagicEffect(toPosition, CONST_ME_POFF)
   elseif isInArray(carrot_dirt, itemEx.itemid) then
       local rand = math.random(2)
       if rand == 1 then
           doCreateItem(2684, 1, toPosition)
       else
           doCreateMonster("rabbit", toPosition)
       end
   end

   return true
end
 
Its a laugh :p

Yeah you can put what ever action id dont have one. I was just wondering if its possible.

Shovel script is :

Lua:
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(isInArray(holes, itemEx.itemid)) then
        local newId = itemEx.itemid + 1
        if(itemEx.itemid == 8579) then
            newId = 8585
        end

        doTransformItem(itemEx.uid, newId)
        doDecayItem(itemEx.uid)
    elseif(isInArray(sand, itemEx.itemid)) then
        local rand = math.random(1, 10000)
        if(itemEx.actionid  == 100 and rand <= 2) then
            doTransformItem(itemEx.uid, 489)
            doDecayItem(itemEx.uid)
        elseif(rand <= 1000) then
            doCreateItem(2152, 1, toPosition)
        elseif(rand <= 2000) then
            doCreateMonster("Scarab", toPosition, false)
        elseif(rand <= 200) then
            doCreateMonster("Ancient Scarab", toPosition, false)
        elseif(rand <= 100) then
            doCreateMonster("Ancient Mummy", toPosition, false)
        elseif(rand <= 40) then
            doCreateMonster("Desert Scorpion", toPosition, false)
        elseif(rand <= 10) then
            doCreateMonster("Pro Banshee", toPosition, false)
        end

        doSendMagicEffect(toPosition, CONST_ME_POFF)
    end

    return true
end


Works great! Than you so much!
 
Lua:
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}
local carrot_dirt = {103}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if(isInArray(holes, itemEx.itemid)) then
       local newId = itemEx.itemid + 1
       if(itemEx.itemid == 8579) then
           newId = 8585
       end

       doTransformItem(itemEx.uid, newId)
       doDecayItem(itemEx.uid)
   elseif(isInArray(sand, itemEx.itemid)) then
       local rand = math.random(1, 10000)
       if(itemEx.actionid  == 100 and rand <= 2) then
           doTransformItem(itemEx.uid, 489)
           doDecayItem(itemEx.uid)
       elseif(rand <= 1000) then
           doCreateItem(2152, 1, toPosition)
       elseif(rand <= 2000) then
           doCreateMonster("Scarab", toPosition, false)
       elseif(rand <= 200) then
           doCreateMonster("Ancient Scarab", toPosition, false)
       elseif(rand <= 100) then
           doCreateMonster("Ancient Mummy", toPosition, false)
       elseif(rand <= 40) then
           doCreateMonster("Desert Scorpion", toPosition, false)
       elseif(rand <= 10) then
           doCreateMonster("Pro Banshee", toPosition, false)
       end

       doSendMagicEffect(toPosition, CONST_ME_POFF)
   elseif isInArray(carrot_dirt, itemEx.itemid) then
       local rand = math.random(2)
       if rand == 1 then
           doCreateItem(2684, 1, toPosition)
       else
           doCreateMonster("rabbit", toPosition)
       end
   end

   return true
end

Works great! Than you so much!
 
Back
Top