local config = {
inicio = {
player2 = {x = 123, y = 123, z =123},
player3 = {x = 456, y = 456, z =456},
player4 = {x = 789, y = 789, z =789}
},
final = {
player1 = {x = 666, y = 666, z =6}, -- Pos final do player que puxou a alavanca ;
player2 = {x = 777, y = 777, z =7},
player3 = {x = 888, y = 888, z =8},
player4 = {x = 999, y = 999, z =9}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
doTeleportThing(cid, config.final.player1)
doPlayerSendTextMessage(cid, 21, "Bem vindo")
if ( isPlayer(getTopCreature(config.inicio.player2).uid) and getTopCreature(config.inicio.player2).uid >= 1 ) then
doPlayerSendTextMessage(getTopCreature(config.inicio.player2).uid, 21, "Bem vindo")
doTeleportThing(getTopCreature(config.inicio.player2).uid, config.final.player2)
return true
end
if ( isPlayer(getTopCreature(config.inicio.player3).uid) and getTopCreature(config.inicio.player3).uid >= 1 ) then
doPlayerSendTextMessage(getTopCreature(config.inicio.player3).uid, 21, "Bem vindo")
doTeleportThing(getTopCreature(config.inicio.player3).uid, config.final.player3)
return true
end
if ( isPlayer(getTopCreature(config.inicio.player4).uid) and getTopCreature(config.inicio.player4).uid >= 1 ) then
doPlayerSendTextMessage(getTopCreature(config.inicio.player4).uid, 21, "Bem vindo")
doTeleportThing(getTopCreature(config.inicio.player4).uid, config.final.player4)
return true
end
return true
end
Lembrando que o player que puxar a alavanca já será teleportado ;