Ir para conteúdo

Featured Replies

  • Respostas 21
  • Visualizações 875
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • function onUse(cid, item, fromPosition, itemEx, toPosition)    local l = {          storage = 45455, -- storage desejada         storage2 = 45457, -- storage da quest, para não fazer novamente       

  • function onUse(cid, item, fromPosition, itemEx, toPosition) local s = 45457 if getPlayerStorageValue(cid, s) > 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você já terminou a qu

Posted Images

Postado
  • Autor
Citar

function onUse(cid, item, frompos, item2, topos)
    if item.uid == 8945 then
        local queststatus = getPlayerStorageValue(cid, 31320)
        local max_gold = 50
        if queststatus == -1 then
            local qtd_gold = math.random(1,50)
            doPlayerSendTextMessage(cid,22,"Parabéns você acabou de completar a reflect quest e recebeu ".. qtd_gold .." golds em uma quantidade aleatória de 0 a ".. max_gold ..". ")
            setPlayerStorageValue(cid, 45455, 1)
            doPlayerAddItem(cid, 2160, qtd_gold)
            setPlayerStorageValue(cid, queststatus, 1)
        else
            doPlayerSendTextMessage(cid,22,"Está vazio.")
        end
    end
    return true
end

Correto?

Eu mudei o id do gold só, mas ainda ta dando pra pegar mais de uma vez.

Postado
4 minutos atrás, diarmaint disse:

Correto?

Eu mudei o id do gold só, mas ainda ta dando pra pegar mais de uma vez.

Correto. Estranho estar podendo pegar mais de uma vez. Pode postar alguma outra quest do server? Pra ver a diferença

Postado
  • Autor

Serve?

Citar

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.uid > 1000 and item.uid < 13000 then
        local itemWeight = getItemWeightById(item.uid, 1)
        local playerCap = getPlayerFreeCap(cid)
        if getPlayerStorageValue(cid, item.uid) == -1 then
            if playerCap >= itemWeight then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
                doPlayerAddItem(cid, item.uid ,1)
                setPlayerStorageValue(cid, item.uid, 1)
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
        end
    else
        return false
    end
    return true
end

 

 

Postado

Script:

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)

   local l = { 
		storage = 45455, -- storage desejada
		storage2 = 1234, -- storage da quest, para não fazer novamente
		gmax = 50, -- quantidade máxima de golds que vai poder ganhar
		gold = 2160, -- Item Id do Gold
		random = math.random(1, gmax)
		}
		
if getPlayerStorageValue(cid, l.storage2) == -1 then
  doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Parabéns você acabou de completar a Reflect Quest e recebeu ' .. l.random .. ' golds.')
  doPlayerAddItem(cid, l.gold, l.random)
  setPlayerStorageValue(cid, l.storage, 1)
  setPlayerStorageValue(cid, l.storage2, 1)
	else
 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você já terminou a quest!')
end
   return true
end

 

 

tag xml:

<action actionid="4000" event="script" value="NomeDoArquivo.lua"/>

 

 

@Tópico movido para área correta, preste mais atenção da próxima vez!!

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

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.6k

Informação Importante

Confirmação de Termo