I got annihilator working and everything, but when you flip the switch to be tele'd down, the switch stays in the same spot so you can't do it more than once everytime you restart. This is the code I have:
Code:
-- annihilator lever
local config = {
monster = "Demon",
positions = {
{x=525, y=768, z=14}, {x=527, y=768, z=14}, {x=529, y=770, z=14},
{x=530, y=770, z=14}, {x=528, y=772, z=14}, {x=526, y=772, z=14}
}
}
function onUse(cid, item, frompos, item2, topos)
local dzwignia = os.clock()
if item.uid == 7000 and item.itemid == 1945 then
local player1pos = {x=525, y=770, z=12, stackpos=253}
local player1 = getThingfromPos(player1pos)
local player2pos = {x=526, y=770, z=12, stackpos=253}
local player2 = getThingfromPos(player2pos)
local player3pos = {x=527, y=770, z=12, stackpos=253}
local player3 = getThingfromPos(player3pos)
local player4pos = {x=528, y=770, z=12, stackpos=253}
local player4 = getThingfromPos(player4pos)
if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
local queststatus1 = getPlayerStorageValue(player1.uid,7000)
local queststatus2 = getPlayerStorageValue(player2.uid,7000)
local queststatus3 = getPlayerStorageValue(player3.uid,7000)
local queststatus4 = getPlayerStorageValue(player4.uid,7000)
if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
local nplayer1pos = {x=525, y=770, z=14}
local nplayer2pos = {x=526, y=770, z=14}
local nplayer3pos = {x=527, y=770, z=14}
local nplayer4pos = {x=528, y=770, z=14}
doSendMagicEffect(player1pos,2)
doSendMagicEffect(player2pos,2)
doSendMagicEffect(player3pos,2)
doSendMagicEffect(player4pos,2)
for i = 1, table.maxn(config.positions) do
doSummonCreature(config.monster, config.positions[i])
end
doTeleportThing(player1.uid,nplayer1pos)
doTeleportThing(player2.uid,nplayer2pos)
doTeleportThing(player3.uid,nplayer3pos)
doTeleportThing(player4.uid,nplayer4pos)
doSendMagicEffect(nplayer1pos,10)
doSendMagicEffect(nplayer2pos,10)
doSendMagicEffect(nplayer3pos,10)
doSendMagicEffect(nplayer4pos,10)
doTransformItem(item.uid,item.itemid+1)
else
doPlayerSendCancel(cid,"Alguem no seu time jah fez a quest.")
end
else
doPlayerSendCancel(cid,"You need 4 players to do Annihilator.")
end
elseif item.uid ==7000 and item.itemid == 1945 then
if (dzwignia - os.clock()) > 60 then
doTransformItem(item.uid,item.itemid-1)
end
if getPlayerAccess(cid) > 0 then
doTransformItem(item.uid,item.itemid-1)
end
end
return TRUE
end