pick.lua
actions.lua
action.xml
The problem is that when the ground is uncovered, there is a hole. After "[color = # FF0000] timer * 1000 [/ color]" hole does not clog the engine and get the error:
If someone can help me?
PHP:
local aID = 777
local ticks = 30
local GRASS = {4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4529, 4540, 4541, 4567, 4568, 4569, 4756}
local DIRT = {351, 352, 353, 354, 355}
local SNOW = {671, 6683, 6684, 6685, 6686, 7002}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local toPositions = {x=toPosition.x, y=toPosition.y, z=toPosition.z, stackpos=0}
if itemEx.actionid == aID then
if isInArray(GRASS, itemEx.itemid) then
doTransformItem(itemEx.uid,470)
doDecayItemTo(toPositions, itemEx.itemid, ticks)
elseif isInArray(DIRT, itemEx.itemid) then
doTransformItem(itemEx.uid,392)
doDecayItemTo(toPositions, itemEx.itemid, ticks)
elseif itemEx.itemid == 231 then
doTransformItem(itemEx.uid,482)
doDecayItemTo(toPositions, itemEx.itemid, ticks)
elseif isInArray(SNOW, itemEx.itemid) then
doTransformItem(itemEx.uid,485)
doDecayItemTo(toPositions, itemEx.itemid, ticks)
else
doCreateItem(3324, 1, toPosition)
doDecayItemTo({x=toPosition.x, y=toPosition.y, z=toPosition.z, stackpos=1}, 0, ticks)
end
elseif itemEx.itemid == 7200 then
doTransformItem(itemEx.uid,7236)
end
return true
end
actions.lua
PHP:
function decayItem(itempos, toitem)
local item = getThingFromPos(itempos)
if (not toitem) or toitem == 0 then
doRemoveItem(item.uid,1)
else
doTransformItem(item.uid,toitem)
end
end
function doDecayItemTo(itempos, toitem, timer)
addEvent(decayItem, timer*1000, itempos, toitem)
return true
end
action.xml
PHP:
<action itemid="2553" script="tools/pick.lua"/>
The problem is that when the ground is uncovered, there is a hole. After "[color = # FF0000] timer * 1000 [/ color]" hole does not clog the engine and get the error:
If someone can help me?