Ir para conteúdo
  • Cadastre-se

(Resolvido)Colocar Storage


Ir para solução Resolvido por gabriel28,

Posts Recomendados

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!

Link para o post
Compartilhar em outros sites
  • 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)
Link para o post
Compartilhar em outros sites
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!

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo