Ir para conteúdo
Entre para seguir isso  
iuniX

Elevador!

Recommended Posts

iuniX    4
iuniX

O vyctor17 me pediu esse script e eu achei bem legalzinho. Lembrando que é um script simples e eu sei disso...

 

Script: Elevador
Autor: iuniX
Testado em: TFS 0.4

 

Explicações:

divisor.png

Ele funciona basicamente igual o elevador de Kazzordon do Tibia Global. Ele pega o item/player/creature que estiver no andar de baixo e teleporta para cima e vise e versa.

 

 

Instalação:

divisor.png

Crie algo parecido com isso no teu server:

 

1º Andar:

 

r10jmo.png

 

 

2º Andar:

 

2rgpbp4.png

 

 

 

 

Scripts:

divisor.png

Tag:

<action actionid="2000;2001" event="script" value="elevador.lua"/>

 

Crie um arquivo .lua na pasta actions/scripts e coloque o nome de elevador.

 

Script:

--[[ Lembrando que você só deve configurar as duas actions ids

    e colocar as duas alavancas com ids diferntes ]]--



function onUse(cid, item)

local aid1,aid2 =  2000, 2001 --Coloque as duas actions ids que vc colocou no actions.xml
local posTile = {
[aid1] = {x= 619,y= 1107,z= 3,stackpos =STACKPOS_TOP_MOVABLE_ITEM_OR_CREATURE},
[aid2] = {x= 619,y= 1107,z= 4,stackpos =STACKPOS_TOP_MOVABLE_ITEM_OR_CREATURE}
}
local posSwitch = {
[aid1] = {x= 620,y= 1107,z= 3,stackpos = 1},
[aid2] = {x= 620,y= 1107,z= 4,stackpos = 1}
}
local switch = getThingFromPos(posSwitch[item.actionid == aid1 and aid2 or aid1])

if (getThingFromPos(posTile[item.actionid]).uid > 0) or (getThingFromPos(posTile[item.actionid == aid1 and aid2 or aid1]).uid > 0) then
if item.itemid == switch.itemid then
	return true
end
	local t1 =  getThingFromPos(posTile[item.actionid == aid1 and aid2 or aid1]).uid
	local t2 =  getThingFromPos(posTile[item.actionid]).uid
	if t1 > 0 then doTeleportThing(t1,posTile[item.actionid]) end
	if t2 > 0 then doTeleportThing(t2, posTile[item.actionid == aid1 and aid2 or aid1]) end
	doSendMagicEffect(posTile[item.actionid == aid1 and aid2 or aid1],CONST_ME_POFF)
	doSendMagicEffect(posTile[item.actionid],CONST_ME_POFF)

else
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_GROUNDSHAKER)
doPlayerSendCancel(cid,"Precisa ter algo encima do Tile do Elevador para ele teleportar.")
end
doTransformItem(switch.uid,item.itemid)
end

Compartilhar este post


Link para o post
vyctor17    35
vyctor17

muito bom '-'

uheuehue brigado iunix *-* rep++

Compartilhar este post


Link para o post
Attacker    0
Attacker

Ótimo para por em casas ou qualquer lugar luxuoso da sua cidade.

Parabéns Iuni,

 

Abraços,

Attacker

Compartilhar este post


Link para o post
dav9shal    1
dav9shal

Daora hein

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×