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
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
data/actions/scripts/shovel.lua:50: attempt to call global 'doCreateMonster' (a nil value)
stack traceback:
data/actions/scripts/shovel.lua:50: in function
<item id="489" article="a" name="hole">
<attribute key="floorchange" value="down"/>
<attribute key="decayTo" value="9059"/>
<attribute key="duration" value="30"/>
<item id="489" article="a" name="hole">
<attribute key="floorchange" value="down"/>
<attribute key="decayTo" value="231"/>
<attribute key="duration" value="30"/>