Ir para conteúdo

Pergunta

7 respostass a esta questão

Posts Recomendados

  • 0

Vá em data/actions/scripts, crie um arquivo chamado machineitem.lua e adicione isso dentro:

 

 

 

local machine = 1234 -- ID DA MAQUINA QUE VAI DAR O ITEM

local useon = 3212 -- ID DO ITEM QUE VAI USAR NA MAQUINA

local gain = 4252 -- ID DO ITEM QUE VAI RECEBER

local exhaust = 6 -- em segundos

local storage = 15458 -- NAO MEXA

 

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

if item.itemid == useon and item2.itemid == machine then

doPlayerAddItem(cid,gain,1)

setPlayerStorageValue(cid, stor_, os.time() + exhaust)

end

return true

end

 

 

 

EM ACTIONS.XML ADICIONE ESSA TAG:

<action event="script" value="machineitem.lua"/>

Editado por Roksas
Link para o comentário
https://xtibia.com/forum/topic/206844-pedido-de-script/#findComment-1462198
Compartilhar em outros sites

  • 0

cade o id na tag oO

e esse script n tem nd a ver com oq o usuario quer o.O

 

@topic

use esse aki...

 

local machine = 1111 --id da machine
local gainItem = {2222, 1} --id do item q vai ganhar, qntdade do item
local delay = 6 --em qnts segs vai ganhar o item..

local function giveItem(cid, id, amount)
if isCreature(cid) then
  doPlayerAddItem(cid, id, amount)   --nao mexe
end
end

function onUse(cid, item, frompos, item2, topos)
if item2.itemid == machine then	
  doRemoveItem(item.uid, 1)
  addEvent(giveItem, delay * 1000, cid, gainItem[1], gainItem[2])
else
  doPlayerSendTextMessage(cid, 27, "You this item only em the correct machine!")
end
return true
end

 

 

tag:

<action itemid="xxxx" event="script" value="yyyy.lua"/>

 

xxxx = id do item q tem q usar na machine...

yyyy = nome do script...

Editado por Slicer
Link para o comentário
https://xtibia.com/forum/topic/206844-pedido-de-script/#findComment-1462212
Compartilhar em outros sites

×
×
  • Criar Novo...