SOLVED BY @WibbenZ
SOLUTION
SOLUTION
Code:
local function revert(item)
local spectators = getSpectators({x = 1008, y = 989, z = 8}, 1, 0)
if spectators ~= nil then
for i = 1, #spectators do
local thing = spectators[i]
if isPlayer(thing) then
doTeleportThing(thing, {x = 1006, y = 989, z = 8})
end
end
doSendMagicEffect({x = 1000, y = 989, z = 8}, CONST_ME_POFF)
end
for i = 1007, 1009 do
doRemoveItem(getTileItemById({x = i, y = 989, z = 8}, 1284).uid, 1)
doCreateItem(598, 1, {x = i, y = 989, z = 8})
end
doTransformItem(item.uid, item.itemid - 1)
doCreateItem(4811, 1, {x = 1007, y = 989, z = 8})
doCreateItem(4809, 1, {x = 1009, y = 989, z = 8})
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
doRemoveItem(getTileItemById({x = 1007, y = 989, z = 8}, 4811).uid, 1)
doRemoveItem(getTileItemById({x = 1009, y = 989, z = 8}, 4809).uid, 1)
for i = 1007, 1009 do
doCreateItem(1284, 1, {x = i, y = 989, z = 8})
end
doTransformItem(item.uid, item.itemid + 1)
doCreatureSay(cid, "You just opened a secret passage!", TALKTYPE_ORANGE_1)
addEvent(revert, 10 * 1000, getThingfromPos(getThingPos(item.uid)))
elseif item.itemid == 1946 then
doPlayerSendCancel(cid, "You can't use this yet.")
end
return true
end
Last edited: