function onUse(cid, item, fromPosition, itemEx, toPosition)
[COLOR="Red"] if(itemEx.uid <= 65535 or itemEx.actionid > 0) and (itemEx.itemid == 354 or itemEx.itemid == 355) then
doTransformItem(itemEx.uid, 392)[/COLOR]
doDecayItem(itemEx.uid)
doSendMagicEffect(toPosition, CONST_ME_POFF)
return TRUE
end
return FALSE
end
Yea, you are right...
...Not.
pick.lua:
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) [COLOR=Red] if(itemEx.uid <= 65535 or itemEx.actionid > 0) and (itemEx.itemid == 354 or itemEx.itemid == 355) then doTransformItem(itemEx.uid, 392)[/COLOR] doDecayItem(itemEx.uid) doSendMagicEffect(toPosition, CONST_ME_POFF) return TRUE end return FALSE end
Wooooooooork!!!
Now, need config to hole de-appears or change to muddy floor again. (In few minutes)
It should decay itself, also, dont use uniqueid since it can not be used on any other hole then. Use the same actionid for each pickhole.
I know, dont use the same uid.
Then, i need create a new function for it?
No, just use lets say actionid 4200 for every pickhole. The script will work as it works with unique one.
--Pick script using action ids by AGS or God Lord
function onUse(cid, item, frompos, item2, topos)
aID = 777 --Action Id the ground tile must have to turn into a hole.
ticks = 30 --How many seconds the hole will last before turning into a normal tile again
topos = {x=topos.x, y=topos.y, z=topos.z}
GRASS = {4526, 4527, 4528, 4529, 4530, 4531, 4532, 4533, 4534, 4535, 4536, 4537, 4538, 4529, 4540, 4541, 4567, 4568, 4569, 4756}
DIRT = {351, 352, 353, 354, 355}
SNOW = {671, 6683, 6684, 6685, 6686, 7002}
if item2.actionid == aID then
if isInArray(GRASS, item2.itemid) == 1 then
doTransformItem(item2.uid,470)
doDecayItemTo(topos, item2.itemid, ticks)
elseif isInArray(DIRT, item2.itemid) == 1 then
doTransformItem(item2.uid,383)
doDecayItemTo(topos, item2.itemid, ticks)
elseif item2.itemid == 231 then
doTransformItem(item2.uid,482)
doDecayItemTo(topos, item2.itemid, ticks)
elseif isInArray(SNOW, item2.itemid) == 1 then
doTransformItem(item2.uid,485)
doDecayItemTo(topos, item2.itemid, ticks)
else
doCreateItem(3324, 1, topos)
doDecayItemTo(topos, 0, ticks)
end
elseif item2.itemid == 7200 then
doTransformItem(item2.uid,7236)
end
end