So usar a tag:
<action itemid="1234" script="SeuScript.lua" allowfaruse="1"/>
aonde ta 1234, e o ID do item
e aonde ta SeuScript.lua e o nome do seu Script em formato lua
Por Wiihtop, 26 de mar. de 2014 em Scripts
info
Grupo: Campones
Registrado: 24/03/14
Posts: 31
Reputação: +1

So usar a tag:
<action itemid="1234" script="SeuScript.lua" allowfaruse="1"/>
aonde ta 1234, e o ID do item
e aonde ta SeuScript.lua e o nome do seu Script em formato lua
tpw mas esse script ta configurado para funcionar apenas se estiver no target, eu queria colocara para quando eu usar algum item em algum player ,,,,...
![]()
upppaaa cade as almas caridosas
info
Grupo: Artesão
Registrado: 22/02/14
Posts: 101
Reputação: +21

local newPos1 = {x = 0, y = 0, z = 0} --pos pra onde sera levado o caster da spell
local newPos2 = {x = 1517, y = 417, z = 6} --pos pra onde sera levado o target
local function teleport(cid, pid, pos, pos2)
if isCreature(cid) then
doTeleportThing(cid, getClosestFreeTile(cid, pos))
doSendMagicEffect(getPlayerPosition(cid), 30)
end
if isCreature(pid) then
doTeleportThing(pid, getClosestFreeTile(pid, pos2 or pos))
doSendMagicEffect(getPlayerPosition(pid), 30)
end
end
function onUse(cid, Item, fromPosition, itemEx, toPosition)
local posCid = getPlayerPosition(cid)
local posTarget = getPlayerPosition(itemEx.uid)
local tempo = 10000 -- 10s
if not isCreature(itemEx.uid) or not isPlayer(itemEx.uid) then
return doPlayerSendTextMessage(cid, 27, "Voce precisa selecionar um alvo para usar o Mangekyou Kamui.")
end
if getPlayerStorageValue(cid, 33333) < os.time () then
setPlayerStorageValue(cid, 33333, os.time () + 30)
teleport(cid, itemEx.uid, newPos1, newPos2)
else
doPlayerSendCancel(cid, "Voce so pode usar esse jutsu daqui a "..getPlayerStorageValue(cid, 33333) - os.time ().." segundos ")
end
return true
end
Testa ai, se não der avisa, que já sei oque ser arrumado. (caso não der).
okay daqui a pouco ja testo e te aviso e ja dou rep++
lucas
e essa aqui
quando eu uso ela apenas me teleporta
tem como modificar para teleportar apenas em quem eu usar?
local toPos = {x = 1029, y = 910, z = 4} --pos para onde o player vai ser teleportado
local tempo = 5 --tempo q ele vai ficar la... em segs
local function teleport(cid, pos)
if isCreature(cid) then
doSendMagicEffect(pos, 21)
doTeleportThing(cid, pos, false)
end
end
function onUse(cid, Item, fromPosition, itemEx, toPosition)
local pos = getPlayerPosition(cid)
doTeleportThing(cid, toPos, false)
doSendMagicEffect(pos, 21)
addEvent(teleport, tempo*1000, cid, pos)
return true
end
info
Grupo: Artesão
Registrado: 22/02/14
Posts: 101
Reputação: +21

local toPos = {x = 1029, y = 910, z = 4} --pos para onde o player vai ser teleportado
local tempo = 5 --tempo q ele vai ficar la... em segs
local pos = getPlayerPosition(itemEx.uid)
local function teleport(cid, pos)
if isCreature(itemEx.uid) then
doSendMagicEffect(pos, 21)
doTeleportThing(itemEx.uid, pos, false)
end
end
function onUse(cid, Item, fromPosition, itemEx, toPosition)
doTeleportThing(itemEx.uid, toPos, false)
doSendMagicEffect(pos, 21)
addEvent(teleport, tempo*1000, itemEx.uid, pos)
return true
end
Editado Março 27 por lucasromero
info
Grupo: Conde
Registrado: 18/01/12
Posts: 988
Reputação: +327
Gênero: Masculino
Char no Tibia: Xerife Woody

Bom já deu pra perceber que o pedido principal do tópico foi resolvido !
e sobre o segundo pedido , você criou outro tópico.
Então, Duvida sanada ?
duu me ajuda pf ): ajuda nessa script
info
Grupo: Conde
Registrado: 18/01/12
Posts: 988
Reputação: +327
Gênero: Masculino
Char no Tibia: Xerife Woody

duu me ajuda pf ): ajuda nessa script
se ta pedindo ajuda sobre o segundo script , respondi lá no outro tópico.
duvida sanada ?
Tópico movido para Pedidos e dúvidas resolvidos.
info
Grupo: Artesão
Registrado: 31/12/10
Posts: 136
Reputação: +1
galera queria transformar essa spell Em actions e que ao inves de eu ficar no target eu queria por na opção de Witch use , que funcione se eu acertar em outro player !!! ......
local newPos1 = {x = 0, y = 0, z = 0} --pos pra onde sera levado o caster da spell
local newPos2 = {x = 1517, y = 417, z = 6} --pos pra onde sera levado o target
local function teleport(cid, pid, pos, pos2)
if isCreature(cid) then
doTeleportThing(cid, getClosestFreeTile(cid, pos))
doSendMagicEffect(getPlayerPosition(cid), 30)
end
if isCreature(pid) then
doTeleportThing(pid, getClosestFreeTile(pid, pos2 or pos))
doSendMagicEffect(getPlayerPosition(pid), 30)
end
end
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if not isCreature(target) or not isPlayer(target) then
return doPlayerSendTextMessage(cid, 27, "Voce precisa selecionar um alvo para usar o Mangekyou Kamui.")
end
if getPlayerStorageValue(cid, 33333) < os.time () then
local target = getCreatureTarget(cid)
local posCid = getPlayerPosition(cid)
local posTarget = getPlayerPosition(target)
local tempo = 10000 -- 10s
setPlayerStorageValue(cid, 33333, os.time () + 30)
teleport(cid, target, newPos1, newPos2)
else
doPlayerSendCancel(cid, "Voce so pode usar esse jutsu daki a "..getPlayerStorageValue(cid, 33333) - os.time ().." segundos ")
end
return true
end
rep++ pra qm ajudar
));
)):