function onUse(cid, item, fromPosition, itemEx, toPosition)
removals = { -- 1304
{ x = 1491 , y = 418 , z = 15, stackpos = 1 },
}
if item.itemid == 1945 then
for i = 1, #removals do
doRemoveItem(getThingfromPos(removals[i]).uid, 1)
end
local LeverPos = {x=1486, y=456, z=12}
doSendMagicEffect(LeverPos, CONST_ME_POFF)
doTransformItem(item.uid, item.itemid + 1)
end
return TRUE
end
<action actionid="6666" event="script" value=".lua"/>
local stonepos = {x=1002, y=1005, z=7, stackpos=1} -- Stone pos
function onUse(cid, item, fromPos, item2, toPos)
if item.itemid == 1945 then
doRemoveItem(getThingfromPos(stonepos).uid, 1)
doTransformItem(item.uid,1946)
addEvent(onTimer5, 2*60*1000) --2minutes
end
return true
end
function onTimer5() --creates wall back
doTransformItem(getThingFromPos({x=1000, y=1006, z=7, stackpos=1}).uid, 1945)--lever pos
doCreateItem(1355,1,{x=1002, y=1005, z=7})-- Stone pos
end
<action actionid="6666" event="script" value="stone.lua"/>
function onUse(cid, item, fromPosition, itemEx, toPosition)
local stone_id = [COLOR="red"]XXXX[/COLOR]
local pos = [COLOR="red"]{x = 100, y = 100, z = 7}[/COLOR]
local stone = getTileItemById(pos, stone_id)
if stone.uid > 0 then
doRemoveItem(stone.uid)
addEvent(function() doCreateItem(stone_id, 1, pos) end, 5 * 60)
return true
else
return doPlayerSendCancel(cid, "Sorry, not possible.")
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
wall_pos = {x=617, y=647, z=12, stackpos=1}
wall = getThingfromPos(wall_pos)
if item.itemid == 1945 and wall.itemid == 1034 then
doSendMagicEffect(wall_pos, 10)
doRemoveItem(wall.uid, 1)
doTransformItem(item.uid, 1946)
addEvent(createWall, 3 * 1000)
elseif item.itemid == 1946 then
doTransformItem(item.uid, 1945)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return TRUE
end
function createWall()
doCreateItem(1034, wall_pos)
doSendMagicEffect(wall_pos, 10)
end
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) local stone_id = [COLOR="red"]XXXX[/COLOR] local pos = [COLOR="red"]{x = 100, y = 100, z = 7}[/COLOR] local stone = getTileItemById(pos, stone_id) if stone.uid > 0 then doRemoveItem(stone.uid) addEvent(function() doCreateItem(stone_id, 1, pos) end, 5 * 60) return true else return doPlayerSendCancel(cid, "Sorry, not possible.") end return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end
Try to search next time![]()