Ir para conteúdo

Featured Replies

Postado

I AI GALERA  UM RAPAZ AQUI DO FORUM MESMO ME DEU ESSE SCRPT QUE PEGA TUDO OK  SO QUE ELE CLONA A ARMADURA E TAL O ITEM NÃO SOME NEM DA PRA USAR UMA VEZ SÓ 

ASSIM CLICA NELE ELE COLOCA AS ARMADURA NOS SLOT CERTO TUDO OK QUE SE TIRAR UMA PEÇA E USAR DA A PEÇA DE NOVO AI  CRIA INFINITO 

QUERIA USAR O ITEM UMA VEZ OU ELE SUMI ELE MUDA OUTF..E VOC TUDO CERTO SO ESSE É O ERRO 

 

ESSE É O SCRIP

 

 

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

local itemids = {
[1] = 2498, -- cabeça
[4] = 2492, --- armor
[5] = 2520, --- direita
[6] = 7404, -- esquerda
[7] = 2470, -- legs
[8] = 11113 --boots
}

local storage = 73182 --- storage que vai ser usada pra salvar se o player já usou ou não
local outfit = 351 -- outfit que vai dar

if getPlayerStorageValue(cid, storage) ~= 1 then
	for i = 1, 8 do
		if (i ~= 2 and i ~= 3) then
		local item = getPlayerSlotItem(cid, i)
			if (item.itemid > 0) then
			doRemoveItem(item.uid)
			end			
	doPlayerAddItem(cid, itemids[i], 1, false)					
		end
	end
doSetCreatureOutfit(cid, {lookType = outfit}, -1)
setPlayerStorageValue(cid, storage, 1)
else
for i = 1, 8 do
		if (i ~= 2 and i ~= 3) then
		local item = getPlayerSlotItem(cid, i)
			if (item.itemid > 0) then
			doRemoveItem(item.uid)
			end	
		end
	end
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, storage, 0)
end

return true
end
<action itemid="10298" script="cdz.lua"/>
Postado
Spoiler

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

  local itemids = {
    [1] = 2498, -- cabeça
    [4] = 2492, --- armor
    [5] = 2520, --- direita
    [6] = 7404, -- esquerda
    [7] = 2470, -- legs
    [8] = 11113 --boots
  }

  local storage = 73182 --- storage que vai ser usada pra salvar se o player já usou ou não
  local outfit = 351 -- outfit que vai dar

  if getPlayerStorageValue(cid, storage) ~= 1 then
    for i = 1, 8 do
      if (i ~= 2 and i ~= 3) then
        local item = getPlayerSlotItem(cid, i)
        if getPlayerItemCount(cid, item.itemid) > 0 then doPlayerRemoveItem(cid, item.itemid, 1) end
        if (item.itemid > 0) then
          doRemoveItem(item.uid)
        end
        doPlayerAddItem(cid, itemids[i], 1, false)
      end
    end
    doSetCreatureOutfit(cid, {lookType = outfit}, -1)
    setPlayerStorageValue(cid, storage, 1)
  else
    for i = 1, 8 do
      if (i ~= 2 and i ~= 3) then
        local item = getPlayerSlotItem(cid, i)
        if getPlayerItemCount(cid, item.itemid) > 0 then doPlayerRemoveItem(cid, item.itemid, 1) end
        if (item.itemid > 0) then
          doRemoveItem(item.uid)
        end
      end
    end
    doRemoveCondition(cid, CONDITION_OUTFIT)
    setPlayerStorageValue(cid, storage, 0)
  end

  return true
end

 

 

Editado por rogaforyn2 (veja o histórico de edições)

Life is so meaningless, there is nothing worth a smile
So goodbye, I'll miss you

 

 

sugestões?

 

 

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

Informação Importante

Confirmação de Termo