Stormoguden
Professional Mapper~
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 7001 and item.itemid == 1945 then
local player1pos = {x=1037, y=1147, z=8, stackpos=253} -- position of player 1
local player1 = getThingfromPos(player1pos)
local player2pos = {x=1037, y=1149, z=8, stackpos=253} -- position of player 2
local player2 = getThingfromPos(player2pos)
if player1.itemid > 0 and player2.itemid > 0 then
local queststatus1 = getPlayerStorageValue(player1.uid,7001)
local queststatus2 = getPlayerStorageValue(player2.uid,7001)
if queststatus1 == -1 and queststatus2 == -1 then
local nplayer1pos = {x=1033, y=1146, z=11, stackpos=253} --- where player 1 will be teleported
local nplayer2pos = {x=1033, y=1148, z=11, stackpos=253} --- where player 2 will be teleported
doSendMagicEffect(player1pos,2)
doSendMagicEffect(player2pos,2)
doTeleportThing(player1.uid,nplayer1pos)
doTeleportThing(player2.uid,nplayer2pos)
doSendMagicEffect(nplayer1pos,10)
doSendMagicEffect(nplayer2pos,10)
doTransformItem(item.uid,item.itemid+1)
end
else
doPlayerSendCancel(cid,"You need 2 players in your team.")
end
elseif item.uid ==7001 and item.itemid == 1946 then
if getPlayerAccess(cid) > 0 then
doTransformItem(item.uid,item.itemid-1)
end
addEvent(reset, 15*60*1000, item)
function reset(item)
doTransformItem(item.uid, item.itemid-1)
end
end
return 1
end
How can I make the lever to reset after 15 minutes? This doesnt work.