WI

Alterar uma action, por favor me ajudem

Por Wiihtop, 27 de mar. de 2014 em Scripts

action teleport
tibia
tp
scripting
action
ajuda
5
856
WiihtopW
27 de março de 2014 às 21:18

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

lucasromeroL
27 de março de 2014 às 21:30


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

WiihtopW
27 de março de 2014 às 22:10

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)

27 de março de 2014 às 22:18
Melhor resposta


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

WiihtopW
27 de março de 2014 às 22:27

rep++ lindu so n t beijo pq n gosto de homem <3