Ir para conteúdo
  • 0

Corrigindo essa spell


Allangod

Pergunta

Essa minha spell era pra teleportar o caster e o target para X lugar durante 30 segundos e depois retornarem para a antiga posição, só que a spell só está teleportando o caster e de vez em quando ela teleporta o caster e um player que está proximo ao target. Alguem poderia corrigir essa spell para que ela só teleporte o Caster e o Target?

Olha ela aí

 

local newPos1 = {x = 548, y = 987, z = 7} --pos pra onde sera levado o caster da spell

local newPos2 = {x = 548, y = 983, z = 7} --pos pra onde sera levado o target

local time = 30 --tempo pra teleporta devolta, em segs

local function teleport(cid, pid, pos, pos2)

if isCreature(cid) then

doTeleportThing(cid, getClosestFreeTile(cid, pos))

doSendMagicEffect(getPlayerPosition(cid), 21)

end

if isCreature(pid) then

doTeleportThing(pid, getClosestFreeTile(pid, pos2 or pos))

doSendMagicEffect(getPlayerPosition(pid), 21)

end

end

 

function onCastSpell(cid, var)

local target = getCreatureTarget(cid)

if not isCreature(target) then

return doPlayerSendTextMessage(cid, 27, "You need a target to do this!")

end

local posCid = getPlayerPosition(cid)

local posTarget = getPlayerPosition(target)

teleport(cid, target, newPos1, newPos2)

addEvent(teleport, time*1000, cid, target, posCid, posTarget)

return true

end

Link para o comentário
https://xtibia.com/forum/topic/213731-corrigindo-essa-spell/
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

×
×
  • Criar Novo...