Hello i need help for action to use pick in "x" sqm and open a hole.
function onUse(cid, item, topos, frompos, itemEx)
local pos, oldGround, newGround, time = {x=652, y=556, z=11, stackpos=0}, 355, 383, 1*60*1000
local f = function()
doTransformItem(getThingfromPos(pos).uid, oldGround)
end
local id = 100 -- action id of the ground
if itemEx.actionid == id then
doTransformItem(getThingfromPos(pos).uid, newGround)
addEvent(f, time)
end
return TRUE
end
i try but no works help me in this script i need well time i want 1 minute of opem hole and tile i want use in tile id 355 to transform in id 383
position is x:652 y:556 z:11
<action actionid="100" script="pick.lua"/>
<action actionid="100" event="script" value="pick.lua"/>
continue not works
function onUse(cid, item, topos, frompos, item2)
local c = {
Pos = {x=652, y=556, z=11, stackpos=0},
oldGround = 355,
newGround = 383,
Time = 1*60*1000,
ActionID = 100
}
local f = function()
doTransformItem(getThingfromPos(c.Pos).uid, c.oldGround)
end
if item2.actionid == ActionID then
doTransformItem(item2.uid, c.newGround)
addEvent(f, c.Time)
end
return TRUE
end