Postado Outubro 22, 2017 7 anos Eae galera do TK, estou precisando de uma ajuda ou melhor de um script. ( EXEMPLO ) : 3 alavancas em determinado locais, de uma quest, preciso puxar por sequencia 1, 2 e 3, e na terceira remove uma pedra por x determinado tempo.... obrigado 3 REP + @Danyel Varejao
Postado Outubro 22, 2017 7 anos @ZeenG Eu tinha feito já para um outro membro, irei postar aqui: Img: Action: Spoiler local config = { action_ids = { alavanca1 = 12550, --ACTIONID DA ALAVANCA1 alavanca2 = 12551, --ACTIONID DA ALAVANCA2 alavanca3 = 12552 --ACTIONID DA ALAVANCA3 }, id_pedra = 3616, --ID DA PEDRA pos_pedra = { [12550] = { --POS DAS PEDRAS DA ALAVANCA 1 {x=118,y=379,z=7}, {x=119,y=379,z=7} }, [12551] = { --POS DAS PEDRAS DA ALAVANCA 2 {x=118,y=379,z=7}, {x=119,y=379,z=7} }, [12552] = { --POS DAS PEDRAS DA ALAVANCA 2 {x=118,y=379,z=7}, {x=119,y=379,z=7} } }, tempo = 20 --tempo do exaust em seg } local t_alavanca = { [1946] = 1945, [1945] = 1946 } function onUse(cid, item, fromPosition, itemEx, toPosition) local id = item.actionid local exaust = getItemAttribute(item.uid, 'exaust') exaust = exaust and exaust or 0 if os.time() <= exaust then doSendMagicEffect(fromPosition,2) return false end for _,pos in pairs(config.pos_pedra[id]) do local pedra = getTileItemById(pos, config.id_pedra) doRemoveItem(pedra.uid) end doItemSetAttribute(item.uid, 'exaust',(os.time() + config.tempo)) addEvent(function() for _,pos in pairs(config.pos_pedra[id]) do doCreateItem(config.id_pedra,1,pos) end end,config.tempo*1000) doTransformItem(item.uid,t_alavanca[item.itemid]) return true end
Postado Outubro 22, 2017 7 anos Autor 1 hora atrás, antharaz disse: @ZeenG Eu tinha feito já para um outro membro, irei postar aqui: Img: Action: Ocultar conteúdo local config = { action_ids = { alavanca1 = 12550, --ACTIONID DA ALAVANCA1 alavanca2 = 12551, --ACTIONID DA ALAVANCA2 alavanca3 = 12552 --ACTIONID DA ALAVANCA3 }, id_pedra = 3616, --ID DA PEDRA pos_pedra = { [12550] = { --POS DAS PEDRAS DA ALAVANCA 1 {x=118,y=379,z=7}, {x=119,y=379,z=7} }, [12551] = { --POS DAS PEDRAS DA ALAVANCA 2 {x=118,y=379,z=7}, {x=119,y=379,z=7} }, [12552] = { --POS DAS PEDRAS DA ALAVANCA 2 {x=118,y=379,z=7}, {x=119,y=379,z=7} } }, tempo = 20 --tempo do exaust em seg } local t_alavanca = { [1946] = 1945, [1945] = 1946 } function onUse(cid, item, fromPosition, itemEx, toPosition) local id = item.actionid local exaust = getItemAttribute(item.uid, 'exaust') exaust = exaust and exaust or 0 if os.time() <= exaust then doSendMagicEffect(fromPosition,2) return false end for _,pos in pairs(config.pos_pedra[id]) do local pedra = getTileItemById(pos, config.id_pedra) doRemoveItem(pedra.uid) end doItemSetAttribute(item.uid, 'exaust',(os.time() + config.tempo)) addEvent(function() for _,pos in pairs(config.pos_pedra[id]) do doCreateItem(config.id_pedra,1,pos) end end,config.tempo*1000) doTransformItem(item.uid,t_alavanca[item.itemid]) return true end Opa meu amigo, obrigado vou já testar aqui, e te falo se deu certo, mas desde já agradeço @antharaz, remove uma pedra de cada vez ?, se for não é bem assim que eu quero, por exemplo quero primeiro puxo a 1 alavanca aí, vou pra segunda aí na terceira que remove a pedra entendeu ? Editado Outubro 22, 2017 7 anos por ZeenG (veja o histórico de edições)
Postado Outubro 23, 2017 7 anos Solução @ZeenG Entendi, neste caso fica assim: Spoiler local config = { id_pedra = 2768, --ID DA PEDRA pos_pedra = {x=98,y=128,z=7}, --pos da pedra tempo = 5, --tempo para a pedra voltar em segundos } local ta = {} function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(ta,item.actionid) then doPlayerSendCancel(cid, "Esta alavanca já foi puxada.") else if #ta == 2 then local pedra = getTileItemById(config.pos_pedra, config.id_pedra) doRemoveItem(pedra.uid) addEvent(function() doCreateItem(config.id_pedra,1,config.pos_pedra) ta = {} end,config.tempo*1000) end table.insert(ta,item.actionid) end return true end
Postado Outubro 24, 2017 7 anos Autor 8 horas atrás, antharaz disse: @ZeenG Entendi, neste caso fica assim: Mostrar conteúdo oculto local config = { id_pedra = 2768, --ID DA PEDRA pos_pedra = {x=98,y=128,z=7}, --pos da pedra tempo = 5, --tempo para a pedra voltar em segundos } local ta = {} function onUse(cid, item, fromPosition, itemEx, toPosition) if isInArray(ta,item.actionid) then doPlayerSendCancel(cid, "Esta alavanca já foi puxada.") else if #ta == 2 then local pedra = getTileItemById(config.pos_pedra, config.id_pedra) doRemoveItem(pedra.uid) addEvent(function() doCreateItem(config.id_pedra,1,config.pos_pedra) ta = {} end,config.tempo*1000) end table.insert(ta,item.actionid) end return true end Amigo meu me ajudou no script já, Mas mesmo assim obrigado, dei rep já e marquei como melhor resposta, pode fechar o topico.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.