Request: Lever+Corpses+RemoveItem&AddItem+Delay+Res tore AllI tems
I'd like to have a code LUA Action that you will have to remove a statue putting a gargolye corpse on some tile using a lever, but in the same time another pedastal in other position, it'll transforms to gargolyie statue. All that will have a 60 seconds of delay and everything come back like was before.
Greetings!
- - - Updated - - -
I get 80% of this script but i need the part of one pedastal transforms yourself to gargoyle statue.
This is my actual script:
- - - Updated - - -
Nobody can help me with this script?
I'd like to have a code LUA Action that you will have to remove a statue putting a gargolye corpse on some tile using a lever, but in the same time another pedastal in other position, it'll transforms to gargolyie statue. All that will have a 60 seconds of delay and everything come back like was before.
Greetings!
- - - Updated - - -
I get 80% of this script but i need the part of one pedastal transforms yourself to gargoyle statue.
This is my actual script:
Code:
local config = {
tile = {x=32360, y=32187, z=7},
corpse_id = 6027,
wall_pos = {x=32356, y=32189, z=7},
wall_id = 8422,
delay = 30,
message = "You have 30 seconds to enter the teleport before the gate closes."
}
function leaverBack(pos, id, new)
return doTransformItem(getTileItemById(pos, id).uid, new)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local corpse = getTileItemById(config.tile, config.corpse_id)
if item.itemid ~= 1945 then return doPlayerSendCancel(cid, "Sorry not possible.") end
if not(corpse.uid > 0) then
return doPlayerSendCancel(cid, "Place the Gargoyle corpse on the right tile.")
end
local wall = getTileItemById(config.wall_pos, config.wall_id)
doRemoveItem(wall.uid)
doRemoveItem(corpse.uid,1)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
doTransformItem(item.uid, 1946)
addEvent(doCreateItem, config.delay*1000, config.wall_id, 1, config.wall_pos)
addEvent(leaverBack, config.delay*1000, getThingPos(item.uid), 1946, 1945)
return true
end
- - - Updated - - -
Nobody can help me with this script?