Script Gate Of Experience

nickissonlobo
em Scripts

nickissonlobo

Niii
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/12/11Posts: 67Char no Tibia: NOt

 

function onUse(cid, item, frompos, item2, topos)

local lvl = 200
if getPlayerLevel(cid) <= lvl then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return true
end
if getPlayerPosition(cid).x > getThingPos(item.uid).x then
doTeleportThing(cid, {x=getThingPos(item.uid).x - 1, y=getThingPos(item.uid).y, z=getThingPos(item.uid).z})
elseif getPlayerPosition(cid).x < getThingPos(item.uid).x then
doTeleportThing(cid, {x=getThingPos(item.uid).x + 1, y=getThingPos(item.uid).y, z=getThingPos(item.uid).z})
elseif getPlayerPosition(cid).y < getThingPos(item.uid).y then
doTeleportThing(cid, {x=getThingPos(item.uid).x, y=getThingPos(item.uid).y + 1, z=getThingPos(item.uid).z})
elseif getPlayerPosition(cid).y > getThingPos(item.uid).y then
doTeleportThing(cid, {x=getThingPos(item.uid).x, y=getThingPos(item.uid).y - 1, z=getThingPos(item.uid).z})
end
return TRUE
end

 

esse script só funciona se vc tiver na frente da porta se vc tiver de kina com ela ele buga teleporta pra parede, quero um que funcione certinho teleporte pra o outro lado da porta rep + pra quem ajudar ai :D

AkatsukiProject. OT De Naruto.

Em Fase de Criação

ShiroNG

Nothing is like the same
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/04/15Posts: 22Char no Tibia: EniX


function onUse(cid, item, fromPosition, item2, toPosition)

 

 

local pos = {x=939, y=926, z=15} -- Posição para onde vai ser teleportado

 

if getPlayerLevel(cid) >= 100 then -- Level para passar

doTeleportThing(cid, pos)

doPlayerSendTextMessage(cid, 22, "Bem vindo") -- Mensagem se ele puder passar

 

else

doPlayerSendTextMessage(cid, 22, "Somente players level 100 ou Superior podem passar!") -- Mensagem se ele não puder passar

 

end

return TRUE

end


<action actionid="1234" event="script" value="Door.lua"/>

 

hvV0caq.png

Jogue Grátis! -

www.pokesky.com

logo2.png

Night Wolf

Coordenador de Desenvolvimento
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 14/02/14Posts: 341Gênero: MasculinoChar no Tibia: Night Wolf

Galera, o importante num script desse estilo de teleportar ao clicar na porta tem que ser o mais abrangente possível pra agrupar todas as portas do servidor em qualquer id, desde que elas estejam na mesma posição. Não usem posições do player pra calcular o sqm q deve ser teleportado, usem os parametros do callback, um deles é a própria posição do item que vc clicou.

Testa assim:

function onUse(cid, item, frompos, item2, topos)
 
local lvl = 200
 
if getPlayerLevel(cid) <= lvl then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return true
end
 
if frompos.x > topos.x then
doTeleportThing(cid, {x=topos.x - 1, y=topos.y, z=topos.z})
elseif frompos.x < topos.x then
doTeleportThing(cid, {x=topos.x + 1, y=topos.y, z=topos.z})
elseif frompos.y < topos.y then
doTeleportThing(cid, {x=topos.x, y=topos.y + 1, z=topos.z})
elseif frompos.y > topos.y then
doTeleportThing(cid, {x=topos.x, y=topos.y - 1, z=topos.z})
end
return true
end

I9AtE9T.png
/NW

nickissonlobo

Niii
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/12/11Posts: 67Char no Tibia: NOt

exatamente isso Night Wolf, mas não funcionou

AkatsukiProject. OT De Naruto.

Em Fase de Criação