Ir para conteúdo
  • 0

Alterar uma action, por favor me ajudem


Wiihtop

Pergunta

precisso modificar essa actions , Eu quero que ela funcione da seguinte maneira

se eu usar ela em algum player ele é teleportado para z x y e depois de 10 segundos volta de onde tinha saido porem , ela esta com um bug , ao eu usar em alguem ela me teleporta nao a pessoa ... !

me ajudem pf

 

 

local toPos = {x = 1029, y = 910, z = 4} --pos para onde o player vai ser teleportado
local tempo = 0 --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

4 respostass a esta questão

Posts Recomendados

  • 0


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

 

 

local toPos = {x = 295, y = 173, z = 7} --pos para onde o player vai ser teleportado

local tempo = 1 --tempo q ele vai ficar la... em segs

 

 

local pos = getCreaturePosition(itemEx.uid)

 

function teleport()

doTeleportThing(itemEx.uid, pos)

doSendMagicEffect(pos, 21)

return true

end

 

 

if isCreature(cid) then

doTeleportThing(itemEx.uid, toPos)

doSendMagicEffect(toPos, 21)

addEvent(teleport, tempo*1000)

end

 

 

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

Link para o comentário
Compartilhar em outros sites

  • 0

erro :/

[27/03/2014 22:10:07] data/actions/scripts/ms.lua:3: attempt to index global 'itemEx' (a nil value)
[27/03/2014 22:10:07] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/ms.lua)

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...