Teste ai pra ver se vai, caso nao for explique um pouco melhor como funciona o script pra eu pensar de outro jeito.
Script do fogo apagado
function onUse(cid, item, fromPosition, itemEx, toPosition)
--FOGO OFF
local gatepos = {x=32313, y=31976, z=13, stackpos=1} --Pos do Campfire que nao acende
local getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min -- Time para acender denovo
local f = function(p)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
doCreateItem(1423,1,gatepos)
end
if item.itemid == 1945 and item.uid == 43995 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421, gatepos)
doTransformItem(item.uid, item.itemid+1)
e = addEvent(f, time * 1000, fromPosition)
else if item.itemid == 1946 and item.uid == 43995 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423, gatepos)
doTransformItem(item.uid,item.itemid-1)
stopEvent(e)
e = 0
end
end
return 1
end
Script do fogo aceso
function onUse(cid, item, fromPosition, itemEx, toPosition)
--FOGO ON
local gatepos = {x=32313, y=31975, z=13, stackpos=1} --Pos do Campfire que Acende
local getgate = getThingfromPos(gatepos)
local time = 300 -- 60 = 1min -- Time para acender denovo
local f = function(p)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
doCreateItem(1423,1,gatepos)
end
if item.itemid == 1945 and item.uid == 43994 and getTileItemById(gatepos, 1423).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1423).uid)
doCreateItem(1421, gatepos)
doTransformItem(item.uid, item.itemid+1)
e = addEvent(f, time * 1000, fromPosition)
else if item.itemid == 1946 and item.uid == 43994 and getTileItemById(gatepos, 1421).uid > 0 then
doRemoveItem(getTileItemById(gatepos, 1421).uid)
doCreateItem(1423, gatepos)
doTransformItem(item.uid,item.itemid-1)
stopEvent(e)
e = 0
end
end
return 1
end
Script Fogo Azul
function onStepIn(cid, item, fromPosition, toPosition)
local positionCurrent = {x=160, y=54, z=7} -- Posicao para onde o player vai se estiver correto a sequencia
local positionFail = {x=160,y=54,z=7} -- Posicao que o player vai se estiver errada a combinacao
--#--Posicões das alavancas--#--
switch1 = {x=32310, y=31975, z=13, stackpos=1}
switch2 = {x=32310, y=31976, z=13, stackpos=1}
switch3 = {x=32312, y=31975, z=13, stackpos=1}
switch4 = {x=32312, y=31976, z=13, stackpos=1}
switch5 = {x=32314, y=31975, z=13, stackpos=1}
switch6 = {x=32314, y=31976, z=13, stackpos=1}
getswitch1 = getThingfromPos(switch1)
getswitch2 = getThingfromPos(switch2)
getswitch3 = getThingfromPos(switch3)
getswitch4 = getThingfromPos(switch4)
getswitch5 = getThingfromPos(switch5)
getswitch6 = getThingfromPos(switch6)
--#--------------------------#--
if isPlayer(cid) then
if getswitch1.itemid == 1946 and getswitch2.itemid == 1946 and getswitch3.itemid == 1946 and getswitch4.itemid == 1946 and getswitch5.itemid == 1945 and getswitch6.itemid == 1945 then
doTeleportThing(cid, positionCurrent)
doSendMagicEffect(getThingPos(cid), 12)
setPlayerStorageValue(cid,10004,1)
setPlayerStorageValue(cid, 10004, 1)
else
doTeleportThing(cid, positionFail)
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You already did this seal.")
end
end
return 0
end