• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Use shovel ankrahmun tombs and dig scarabs

Daniel13

New Member
Joined
Nov 30, 2008
Messages
178
Reaction score
1
Hiho in my server can't use shovel in ankrahmun ;/
through it you can not get to the Tombs or dig scarabs
 
Post your shovel.lua and which server you use.
You can also use the shovel.lua from TFS 0.3.6 as example.
Code:
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, 100)
     if(itemEx.actionid  == 100 and rand <= 20) then
       doTransformItem(itemEx.uid, 489)
       doDecayItem(itemEx.uid)
     elseif(rand >= 1 and rand <= 5) then
       doCreateItem(2159, 1, toPosition)
     elseif(rand > 85) then
       doCreateMonster("Scarab", toPosition, false)
     end

     doSendMagicEffect(toPosition, CONST_ME_POFF)
   end

   return true
end
You can just add the ids you want to the tables holes and sand.
 
this script not work ;/ i can now use shovel in sand also can't open hole ;/ in rme i see actionid 5000 in hide hole sqm maybe you have script for it ?
 
Post your shovel.lua and which server you use.
You can use this script (this is the default shovel script from TFS 0.3.6) as example to see how to do it, if you get errors, post them.
 
My shovel.lua

Code:
function onUse(cid, item, frompos, item2, topos)
        if item2.itemid == 0 then
                return 0
        end  

        if item2.itemid == 468 then
                doTransformItem(item2.uid,469)

        elseif item2.itemid == 481 then
                doTransformItem(item2.uid,482)

        elseif item2.itemid == 483 then
                doTransformItem(item2.uid,484)

        elseif item2.itemid == 1335 then
                doTransformItem(item2.uid,383)

        elseif item2.itemid == 293 then
                doTransformItem(item2.uid,294)
        else
                return 0
        end

        doDecayItem(item2.uid)
     
        return 1
end

local holes = {468, 481, 483, 1335, 293,}
local sand = {231,}

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, 100)
     if(itemEx.actionid  == 100 and rand <= 20) then
       doTransformItem(itemEx.uid, 489)
       doDecayItem(itemEx.uid)
     elseif(rand >= 1 and rand <= 5) then
       doCreateItem(2159, 1, toPosition)
     elseif(rand > 85) then
       doCreateMonster("Scarab", toPosition, false)
     end

     doSendMagicEffect(toPosition, CONST_ME_POFF)
   end

   return true
end

scarab coin now i can dig :p scarabs can't ;/

Code:
data/actions/scripts/shovel.lua:50: attempt to call global 'doCreateMonster' (a nil value)
stack traceback:
data/actions/scripts/shovel.lua:50: in function
Edit : i fix /\ this error ;)


I use server OTHire-master ( 7.7 )
 
Post which server you use.

If you want to try the shovel script from TFS 0.3.6 in your server, then use that script, not add it to your shovel script.
You now have function onUse twice, so remove everything from your shovel.lua script and add what I posted.
If you get errors after that, post them.
 
now i use you script and no have errors.

but i use shovel on hidden hole and i dig only 2 scarabs and 3 scarab coins xd hole every time hidden ;/


i use server OTHire-master 7.7
 
look on screen ;/

Hole Hidden :

dziura1.png


Next i open hidden hole :

dziuraoyo.png


and after a while the hole is closed and create a error ;/

dziura3.png
 
i fix it ;) in items.xml i change :

Code:
    <item id="489" article="a" name="hole">
        <attribute key="floorchange" value="down"/>
        <attribute key="decayTo" value="9059"/>
        <attribute key="duration" value="30"/>

on :

Code:
    <item id="489" article="a" name="hole">
        <attribute key="floorchange" value="down"/>
        <attribute key="decayTo" value="231"/>
        <attribute key="duration" value="30"/>
 
Back
Top