leandroskt8 2 Postado Agosto 15, 2012 Share Postado Agosto 15, 2012 (editado) quero quando player upar x level ganhar x iten conforme esta no script só que n sei que ta de errado nele alguem me ajuda ai pf valendo rep+ local configuracao = { efeito = {27,28, 29,79}, -- Efeito que vai mandar ao avançar de level. } function onAdvance(cid, skill, oldLevel, newLevel) if getPlayerStorageValue(cid, 25686) >= 1 or getPlayerStorageValue(cid, 25687) >= 1 then return true end if (getPlayerLevel(cid) == 150) then doPlayerAddItem(cid, 7424, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25686, 1) elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 4, 8, 12 then -- vocações doPlayerAddItem(cid, 115, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25687, 1) elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 3, 7, 11 then -- vocações doPlayerAddItem(cid, 2352, 1) doPlayerAddItem(cid, 7438, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25687, 1) elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 2, 10, 6 then -- vocações doPlayerAddItem(cid, 7424, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25687, 1) elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 1, 5, 9 then -- vocações doPlayerAddItem(cid, 7424, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25687, 1) end return true end preciso para essas vocações e esses itens . Obg Editado Agosto 15, 2012 por godleandro Link para o comentário https://xtibia.com/forum/topic/192008-ajuda-nessse-escript-erro/ Compartilhar em outros sites More sharing options...
0 PostadorHunter 99 Postado Agosto 15, 2012 Share Postado Agosto 15, 2012 (editado) na area de sprites ??? reportado para moverem na area de sprites ??? reportado para moverem ali en cima tem um return true end na mesma linha tenta dakela linha la botar assim normal function onAdvance(cid, skill, oldLevel, newLevel) if getPlayerStorageValue(cid, 25686) >= 1 or getPlayerStorageValue(cid, 25687) >= 1 then return true end if (getPlayerLevel(cid) == 150) then doPlayerAddItem(cid, 7424, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25686, 1) editado function onAdvance(cid, skill, oldLevel, newLevel) if getPlayerStorageValue(cid, 25686) >= 1 or getPlayerStorageValue(cid, 25687) >= 1 then if (getPlayerLevel(cid) == 150) then doPlayerAddItem(cid, 7424, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25686, 1) se n der bota return true end dps disso Editado Agosto 15, 2012 por PostadorHunter Link para o comentário https://xtibia.com/forum/topic/192008-ajuda-nessse-escript-erro/#findComment-1317111 Compartilhar em outros sites More sharing options...
0 Newtonnotwen 80 Postado Agosto 16, 2012 Share Postado Agosto 16, 2012 (editado) Em data/creaturescripts/scripts crie um arquivo.lua nomeie para upgain e adicione: local vocationsItem = { [1] = 7759, [2] = 7760, [3] = 7761, [4] = 7762 } local lvlGain = 20 function onAdvance(cid, skill, oldLevel, newLevel) if (getPlayerLevel(cid) == lvlGain and getPlayerStorageValue(cid, 403245) ~= 1) then doPlayerAddItem(cid, vocationsItem[getPlayerVocation(cid)]) setPlayerStorageValue(cid, 403245, 1) end return true end Editando: -Vermelho: Id da vocação -Laranja: Id do item -Verde: Level para ganhar o item Em creaturescripts.xml adicione: <event type="advance" name="upgain" event="script" value="upgain.lua"/> Para adicionar mais itens faça o seguinte: Copie o arquivo em roxo: [1] = 7759, [2] = 7760, [3] = 7761, [4] = 7762 } Duplique no seguinte lugar (em marrom): [1] = 7759, [2] = 7760, [2] = 7760, [3] = 7761, [4] = 7762 } E depois apenas edite o id da vocação e do item. Ex: [1] = 7759, [2] = 7760, [5] = 8595, [3] = 7761, [4] = 7762 -Verde: O que foi editado Editado Agosto 16, 2012 por Newtonnotwen Link para o comentário https://xtibia.com/forum/topic/192008-ajuda-nessse-escript-erro/#findComment-1317487 Compartilhar em outros sites More sharing options...
0 leandroskt8 2 Postado Agosto 17, 2012 Autor Share Postado Agosto 17, 2012 vlw rep + Link para o comentário https://xtibia.com/forum/topic/192008-ajuda-nessse-escript-erro/#findComment-1317807 Compartilhar em outros sites More sharing options...
0 Newtonnotwen 80 Postado Agosto 17, 2012 Share Postado Agosto 17, 2012 De nada. Duvida sanada. Link para o comentário https://xtibia.com/forum/topic/192008-ajuda-nessse-escript-erro/#findComment-1317810 Compartilhar em outros sites More sharing options...
Pergunta
leandroskt8 2
quero quando player upar x level ganhar x iten conforme esta no script só que n sei que ta de errado nele alguem me ajuda ai pf valendo rep+
local configuracao = { efeito = {27,28, 29,79}, -- Efeito que vai mandar ao avançar de level. } function onAdvance(cid, skill, oldLevel, newLevel) if getPlayerStorageValue(cid, 25686) >= 1 or getPlayerStorageValue(cid, 25687) >= 1 then return true end if (getPlayerLevel(cid) == 150) then doPlayerAddItem(cid, 7424, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25686, 1) elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 4, 8, 12 then -- vocações doPlayerAddItem(cid, 115, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25687, 1) elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 3, 7, 11 then -- vocações doPlayerAddItem(cid, 2352, 1) doPlayerAddItem(cid, 7438, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25687, 1) elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 2, 10, 6 then -- vocações doPlayerAddItem(cid, 7424, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25687, 1) elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 1, 5, 9 then -- vocações doPlayerAddItem(cid, 7424, 1) doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)]) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, ) setPlayerStorageValue(cid, 25687, 1) end return true endpreciso para essas vocações e esses itens .
Link para o comentário
https://xtibia.com/forum/topic/192008-ajuda-nessse-escript-erro/Compartilhar em outros sites
4 respostass a esta questão
Posts Recomendados