2022-07-04 15:07:04 - -----
2022-07-04 15:07:04 - 65535
2022-07-04 15:07:04 - 64
2022-07-04 15:07:04 - 0
2022-07-04 15:07:04 -
2022-07-04 15:07:04 - [Error - Action Interface]
2022-07-04 15:07:04 - data/actions/scripts/tools/shovel.luanUse
2022-07-04 15:07:04 - Description:
2022-07-04 15:07:04 - (luaGetThingFromPosition) Tile not found
2022-07-04 15:07:05 - -----
2022-07-04 15:07:05 - 65535
2022-07-04 15:07:05 - 64
2022-07-04 15:07:05 - 0
2022-07-04 15:07:05 -
2022-07-04 15:07:05 - [Error - Action Interface]
2022-07-04 15:07:05 - data/actions/scripts/tools/shovel.luanUse
2022-07-04 15:07:05 - Description:
2022-07-04 15:07:05 - (luaGetThingFromPosition) Tile not found
TOOLS.SHOVEL = function(cid...
2022-07-04 15:07:04 - -----Tell us what prints when you get this error.
Lua:TOOLS.SHOVEL = function(cid, item, fromPosition, itemEx, toPosition) print("-----") print(toPosition.x, toPosition.y, toPosition.z) for i = 0, 255 do local check_pos = {x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = i} local target = getThingFromPos(check_pos) if target.itemid <= 0 then break elseif isInArray(HOLES, target.itemid) then itemEx = target break end end 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) local ground = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_GROUND}) if(isInArray(SPOTS, ground.itemid) 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
2022-07-04 15:07:04 - -----
2022-07-04 15:07:04 - 65535
2022-07-04 15:07:04 - 64
2022-07-04 15:07:04 - 0
2022-07-04 15:07:04 -
2022-07-04 15:07:04 - [Error - Action Interface]
2022-07-04 15:07:04 - data/actions/scripts/tools/shovel.luanUse
2022-07-04 15:07:04 - Description:
2022-07-04 15:07:04 - (luaGetThingFromPosition) Tile not found
2022-07-04 15:07:05 - -----
2022-07-04 15:07:05 - 65535
2022-07-04 15:07:05 - 64
2022-07-04 15:07:05 - 0
2022-07-04 15:07:05 -
2022-07-04 15:07:05 - [Error - Action Interface]
2022-07-04 15:07:05 - data/actions/scripts/tools/shovel.luanUse
2022-07-04 15:07:05 - Description:
2022-07-04 15:07:05 - (luaGetThingFromPosition) Tile not found
TOOLS.SHOVEL = function(cid, item, fromPosition, itemEx, toPosition)
if toPosition.x == 65535 then -- if the target of the shovel is in the player inventory..
return true -- do nothing
end
for i = 0, 255 do
local check_pos = {x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = i}
local target = getThingFromPos(check_pos)
if target.itemid <= 0 then
break
elseif isInArray(HOLES, target.itemid) then
itemEx = target
break
end
end
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)
local ground = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_GROUND})
if(isInArray(SPOTS, ground.itemid) 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
Works, thank you!Lua:TOOLS.SHOVEL = function(cid, item, fromPosition, itemEx, toPosition) if toPosition.x == 65535 then -- if the target of the shovel is in the player inventory.. return true -- do nothing end for i = 0, 255 do local check_pos = {x = toPosition.x, y = toPosition.y, z = toPosition.z, stackpos = i} local target = getThingFromPos(check_pos) if target.itemid <= 0 then break elseif isInArray(HOLES, target.itemid) then itemEx = target break end end 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) local ground = getThingFromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_GROUND}) if(isInArray(SPOTS, ground.itemid) 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