Postado Abril 18, 2018 7 anos Spoiler function onUse(cid, item) local magia = "Target Spell" if getPlayerLearnedInstantSpell(cid, magia) then doPlayerSendTextMessage(cid,25,"You already learned everything from this scroll.") elseif doPlayerLearnInstantSpell(cid, magia) then local pos = getCreaturePosition(cid) doSendMagicEffect(pos, 0) doPlayerSendTextMessage(cid,19,"By reading this ancient scroll you learned the secrets of "..magia..".") end end Galera tenho esse script ai, Sò que eu precisava que coloca-se uma storage quando usa-se o item para nao ter que repetir. Pois coloquei 3 runas que quando der use ganha a spell, porem n quero que aprenda todas as 3 spells apenas uma delas, alguem poderia ajudar com isso? Colocando uma storage ai, que pode ser editavel da forma que eu achar melhor??? Obrigado!
Postado Abril 18, 2018 7 anos Solução @gutalo Poem a mesma storage em todas as runas, assim, se o player usar uma, não poderá usar mais nenhuma. function onUse(cid, item) local magia = "Target Spell" local storage = 827474 local pos = getCreaturePosition(cid) if getPlayerStorageValue(cid, storage) <= 0 then if getPlayerLearnedInstantSpell(cid, magia) then doPlayerSendTextMessage(cid,25,"You already learned everything from this scroll.") elseif doPlayerLearnInstantSpell(cid, magia) then doSendMagicEffect(pos, 0) setPlayerStorageValue(cid, storage, 1) doPlayerSendTextMessage(cid,19,"By reading this ancient scroll you learned the secrets of "..magia..".") end else doPlayerSendCancel(cid, "You already learned one spell from some rune.") end end Editado Abril 18, 2018 7 anos por gabriel28 (veja o histórico de edições)
Postado Abril 18, 2018 7 anos Autor 1 minuto atrás, gabriel28 disse: @gutalo function onUse(cid, item) local magia = "Target Spell" local storage = 827474 local pos = getCreaturePosition(cid) if getPlayerStorageValue(cid, storage) <= 0 then if getPlayerLearnedInstantSpell(cid, magia) then doPlayerSendTextMessage(cid,25,"You already learned everything from this scroll.") elseif doPlayerLearnInstantSpell(cid, magia) then doSendMagicEffect(pos, 0) setPlayerStorageValue(cid, storage, 1) doPlayerSendTextMessage(cid,19,"By reading this ancient scroll you learned the secrets of "..magia..".") end else doPlayerSendCancel(cid, "You already learned one spell from some rune.") end end Irei testar! PErfeito Valeu... não mostra aquela ultima mensagem, Spoiler function onUse(cid, item) local magia = "lendary regeneration" local storage = 827474 local pos = getCreaturePosition(cid) if getPlayerStorageValue(cid, storage) <= 0 then if getPlayerLearnedInstantSpell(cid, magia) then doPlayerSendTextMessage(cid,25,"Voce ja aprendeu esta tecnica!") elseif doPlayerLearnInstantSpell(cid, magia) then doSendMagicEffect(pos, 0) doRemoveItem(item.uid,1) setPlayerStorageValue(cid, storage, 1) doPlayerSendTextMessage(cid,19,"O poder lendario desta runa te ensinou a tecnica "..magia..".") end else doPlayerSendCancel(cid, "VOce ja aprendeu alguma outra runa!.") end end "voce ja aprendeu alguma outra runa!" Mas de resto perfeito!
Postado Abril 18, 2018 7 anos @gutalo De nada. Não sei porque não ta indo, mas é só trocar por: doPlayerSendTextMessage(cid,25,"Voce ja aprendeu alguma outra runa!.") que vai. Marca como melhor resposta pra fecharem o tópico.
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.