WI
pedido

Ao usar em alguem ele copia mana ao usar em min a funçao dotransform...

Por Wiihtop, 31 de mar. de 2014 em Scripts

pf
action
script
tibia
narutibia
8
1.2k
WiihtopW
31 de março de 2014 às 23:37

GALERA PRECISSO DE AJUDA

QUERO DEIXAR ESSE ITEM O SEGUINTE SE EU USAR EM ALGUEM ELE COPIA MANA,

AGORA SE EU USAR ELE EM MIN ELE ACONTECE A FUNÇAO DOTRANSFORM ITEM ... !

POREM NAO ESTOU CONSEGUINDO ME AJUDEM, ! rep++

 

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

local ids = {13,14} --Coloque o ID das vocations nesta tabela.
local storage = 1234 -- storage
local time = 60 -- tempo em minutos


local mana = getCreatureMana(itemEx.uid)


if getTilePzInfo(getCreaturePosition(cid)) or getTilePzInfo(getCreaturePosition(itemEx.uid)) then
return false
end

if isInArray(ids, getPlayerVocation(cid)) then
if getPlayerStorageValue(cid, storage) - os.time() <= 0 then
if isPlayer(itemEx.uid) then
doCreatureAddMana(itemEx.uid, -mana)
doCreatureAddMana(cid, mana)
doSendMagicEffect(getCreaturePosition(cid), 11)
doSendMagicEffect(getCreaturePosition(itemEx.uid), 12)
setPlayerStorageValue(cid, storage, os.time()+1*60)
else
doPlayerSendCancel(cid, "Você só pode usar o item em players.")
end
else
doPlayerSendCancel(cid, "Você só pode usar o item a cada "..time.." segundos.")
end

return true
end
end

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


local item1 = 2553
local health = 50 -- %
local mana = 50 -- %


local h = (getCreatureHealth(cid))*(health)/(100)
local m = (getCreatureMana(cid))*(mana)/(100)
doCreatureAddHealth(cid, -h)
doCreatureAddMana(cid, -m)
doTransformItem(item.uid, item1)
doCreatureSay(cid, 'Mangekyou Sharingan!', TALKTYPE_ORANGE_1)
end
return true
end


upa

01 de abril de 2014 às 10:08

não entendi , doTransformItem ?, o item vai se transformar em quer ?

WiihtopW
01 de abril de 2014 às 15:18

exemplo se eu usar essa aaction em alguem ela copia a mana, agora se eu usa-la ela em min ela se transforma num item 2106

lucasromeroL
01 de abril de 2014 às 15:46


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

local voc = {13,14}

if isPlayer(itemEx.uid) then

if isInArray(voc, getPlayerVocation(cid)) then

if getCreatureName(itemEx.uid) ~= getCreatureName(cid) then

doCreatureAddMana(cid, getCreatureMana(itemEx.uid))

else

doTransformItem(item.uid, 2106)

doPlayerSendCancel(cid, "Voce nao pode usar esse item em voce mesmo.")

end

else

doPlayerSendCancel(cid, "Voce nao pode usar esse item.")

end

else

return doPlayerSendCancel(cid, "Voce so pode usar esse item em Players.")

end

return true

end

Editado Abril 1 por lucasromero

WiihtopW
01 de abril de 2014 às 16:53

deu errado esse se eu ussar na pessoa o item tbm transforma

eu queria que ele so mudasse se eu usa-se o item em min

exemplo

se eu usa-se na pessoa ele apenas copiaria mana

agora se eu usa-se em min ele tranfsformaria para outro item ......

01 de abril de 2014 às 17:13
Melhor resposta


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

 

local ids = {13,14} --Coloque o ID das vocations nesta tabela.

local storage = 1234 -- storage

local time = 60 -- tempo em minutos

 

if itemEx.uid == cid then

return doTransformItem(item.uid, 2106)

end

 

local mana = getCreatureMana(itemEx.uid)

 

if getTilePzInfo(getCreaturePosition(cid)) or getTilePzInfo(getCreaturePosition(itemEx.uid)) then

return false

end

 

if isInArray(ids, getPlayerVocation(cid)) then

if getPlayerStorageValue(cid, storage) - os.time() <= 0 then

if isPlayer(itemEx.uid) then

doCreatureAddMana(itemEx.uid, -mana)

doCreatureAddMana(cid, mana)

doSendMagicEffect(getCreaturePosition(cid), 11)

doSendMagicEffect(getCreaturePosition(itemEx.uid), 12)

setPlayerStorageValue(cid, storage, os.time()+1*60)

else

doPlayerSendCancel(cid, "Você só pode usar o item em players.")

end

else

doPlayerSendCancel(cid, "Você só pode usar o item a cada "..time.." segundos.")

end

end

 

return true

end

WiihtopW
01 de abril de 2014 às 20:27

te amo como sempre du <3

01 de abril de 2014 às 21:12

Tópico movido para Pedidos e dúvidas resolvidos.