Ir para conteúdo
  • 0

PEDIDO ACTION DE TELEPORT MODIFICAR


Wiihtop

Pergunta

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


));


)):

Link para o comentário
Compartilhar em outros sites

8 respostass a esta questão

Posts Recomendados

  • 0

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

Link para o comentário
Compartilhar em outros sites

  • 0
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).

Link para o comentário
Compartilhar em outros sites

  • 0

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

Link para o comentário
Compartilhar em outros sites

  • 0


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 por lucasromero
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...