Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
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!

Resolvido por gabriel28

Ir para solução
Postado
  • 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 por gabriel28 (veja o histórico de edições)

Postado
  • 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!

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo