Ir para conteúdo

para usa essa chest precisa ser level 300 alguem sabe bota o level 300 pra da use na chest

Featured Replies

Postado
function onUse(cid, item, frompos, item2, topos)

   	if item.uid == 1664 then
   		queststatus = getPlayerStorageValue(cid,1664)
   		if queststatus == -1 then
			doPlayerSendTextMessage(cid,25,"Parabens Ganho 3kk.")
			doPlayerAddItem(cid,2160,300)
                        doPlayerAddItem(cid,2383,1)                    
                       doPlayerAddItem(cid,2390,1)
                       doPlayerAddItem(cid,10518,1)
                      doPlayerAddItem(cid,2471,1)
                          doPlayerAddItem(cid,2646,1)
                      doPlayerAddItem(cid,2469,1)
                          doPlayerAddItem(cid,2523,1)
                         doPlayerAddItem(cid,2494,1)
                        doPlayerAddItem(cid,8926,1)
                             doPlayerAddItem(cid,7431,1)
                            doPlayerAddItem(cid,7368,1)
                            doPlayerAddItem(cid,8910,1)
                          doPlayerAddItem(cid,2789,100)
                         doPlayerAddItem(cid,10518,1)
			setPlayerStorageValue(cid,1664,1)
	else
   			doPlayerSendTextMessage(cid,22,"Voce ja pegou o bonus")
   		end
      	else
		return 0
   	end

   	return 1
end

 

Resolvido por Fabi Marzan

Ir para solução
Postado
  • Solução
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 1664 then
    queststatus = getPlayerStorageValue(cid,1664)
        if queststatus == -1 then
            if getPlayerLevel(cid) >= 300 then
                doPlayerSendTextMessage(cid,25,"Parabens Ganho 3kk.")
                doPlayerAddItem(cid,2160,300)
                doPlayerAddItem(cid,2383,1)                    
                doPlayerAddItem(cid,2390,1)
                doPlayerAddItem(cid,10518,1)
                doPlayerAddItem(cid,2471,1)
                doPlayerAddItem(cid,2646,1)
                doPlayerAddItem(cid,2469,1)
                doPlayerAddItem(cid,2523,1)
                doPlayerAddItem(cid,2494,1)
                doPlayerAddItem(cid,8926,1)
                doPlayerAddItem(cid,7431,1)
                doPlayerAddItem(cid,7368,1)
                doPlayerAddItem(cid,8910,1)
                doPlayerAddItem(cid,2789,100)
                doPlayerAddItem(cid,10518,1)
                setPlayerStorageValue(cid,1664,1)
            else
                doPlayerSendTextMessage(cid,22,"Precisa do level 300 pra ussar.")
            end
        else
            doPlayerSendTextMessage(cid,22,"Voce ja pegou o bonus")
        end
    else
    return 0
end
    return 1
end

 

  • 3 weeks later...
Postado

seria uma boa otimizar o script mano, desse modo ele ta bem "mal feito"

 

local config = {
	items = {
    	{2160, 300}, {2383, 1}, {2390, 1}, {10518, 1}, {2471, 1}, {2646, 1}, {2469, 1}, {2523, 1}, 
  		{2494, 1}, {8926, 1}, {7431, 1}, {7368, 1}, {8910, 1}, {2789, 100}, {1664, 1}
  }
}

function onUse(cid, item, frompos, item2, topos)
   	if item.uid == 1664 then
   		queststatus = getPlayerStorageValue(cid,1664)
   		if queststatus == -1 then
			doPlayerSendTextMessage(cid,25,"Parabens Ganho 3kk.")
      		for i=1, #config.items do
				doPlayerAddItem(cid, config.items[i][1], config.items[i][2])
			end
		else
   			doPlayerSendTextMessage(cid,22,"Voce ja pegou o bonus")
   		end
   	end

   	return true
end


fica mais organizado e mais legivel

Postado
local rewards = {
    {itemid = 2160, count = 300},  
    {itemid = 2383, count = 1},    
    {itemid = 2390, count = 1},    
    {itemid = 10518, count = 1},   
    {itemid = 2471, count = 1},    
    {itemid = 2646, count = 1},   
    {itemid = 2469, count = 1},    
    {itemid = 2523, count = 1},   
    {itemid = 2494, count = 1},    
    {itemid = 8926, count = 1},    
    {itemid = 7431, count = 1},    
    {itemid = 7368, count = 1},    
    {itemid = 8910, count = 1},    
    {itemid = 2789, count = 100}  
}

function onUse(cid, item, frompos, item2, topos)
    if item.uid == 1664 then
        local queststatus = getPlayerStorageValue(cid, 1664)
        if queststatus == -1 then
            if getPlayerLevel(cid) >= 300 then
                doPlayerSendTextMessage(cid, 25, "Parabéns! Você ganhou 3kk e os seguintes itens:")
                for _, reward in ipairs(rewards) do
                    doPlayerAddItem(cid, reward.itemid, reward.count)
                end
                setPlayerStorageValue(cid, 1664, 1)
            else
                doPlayerSendTextMessage(cid, 22, "Você precisa ser level 300 para usar este item.")
            end
        else
            doPlayerSendTextMessage(cid, 22, "Você já pegou o bônus.")
        end
    end
    return true
end

Ou você pode optar por uma alternativa. O script é bastante simples e está otimizado!.

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