Ir para conteúdo
  • 0

Summons Subir Escadas


nbb147

Pergunta

galera eu tenho um script aki que faz summons teleportarem para onde o dono for mais tem um problema, ele so teleporta 1 summon, eu quero que ele teleporte, todos os summons, abaixo o script:

 

GlobaEvents:

 

 

 

function onThink(interval, lastExecution, thinkInterval)

local tabla = {}

local maxDistance = 10

for _, pid in ipairs(getPlayersOnline()) do

local summons = getCreatureSummons(pid)

if #summons > 0 then --------- Eu ja tentei regular aki mais nao da certo..

table.insert(tabla, pid)

end

end

for _, t in ipairs(tabla) do

local summ = getCreatureSummons(t)

if getThingPos(t).z ~= getThingPos(summ[1]).z or getDistanceBetween(getThingPos(t), getThingPos(summ[1])) > maxDistance then

doTeleportThing(summ[1], getThingPos(t))

doSendMagicEffect(getThingPos(t), 12)

end

end

return true

end

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
function onThink(interval, lastExecution, thinkInterval)
local maxDistance = 10
   for _, pid in pairs(getPlayersOnline()) do
    local summons = getCreatureSummons(pid)
    if #summons ~= 0 then
	    for _, sid in pairs (summons) do
		    if getThingPos(sid).z ~= getThingPos(pid).z or getDistanceBetween(getThingPos(sid), getThingPos(pid)) > maxDistance then
			    doTeleportThing(sid, getThingPos(pid), false)
			    doSendMagicEffect(getThingPos(sid), 12)
		    end
	    end
    end
   end
return true
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...