Estou esperando você me dizer qual a versão do seu servidor.
11
971
10 de maio de 2015 às 16:36
info
Grupo: Conde
Registrado: 29/07/13
Posts: 780
Reputação: +60
Gênero: Masculino
Char no Tibia: aguarde...

10 de maio de 2015 às 16:48
versão do servidor 10.76 tfs 1.1
10 de maio de 2015 às 16:50
local playerPosition = {
{x = 33607, y = 32362, z = 11},
{x = 33608, y = 32362, z = 11}, -- posição dos pisos.
{x = 33609, y = 32362, z = 11},
{x = 33610, y = 32362, z = 11}
}
local newPosition = {
{x = 33527, y = 32331, z = 12},
{x = 33529, y = 32332, z = 12}, -- posição que os player sera teleportado.
{x = 33528, y = 32334, z = 12},
{x = 33527, y = 32333, z = 12}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 1945 then
local players = {}
for _, pos in ipairs(playerPosition) do
local topPlayer = Tile(pos):getTopCreature()
if topPlayer == nil or not topPlayer:isPlayer() or topPlayer:getLevel() < 100 or topPlayer:getStorageValue(30017) ~= -1 then
return false
end
players[#players + 1] = topPlayer
end
for i, tmpPlayer in ipairs(players) do
Position(playerPosition[i]):sendMagicEffect(CONST_ME_POFF)
tmpPlayer:teleportTo(newPosition[i], false)
tmpPlayer:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA)
end
item:transform(1946)
elseif item.itemid == 1946 then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
end
return true
end
Você disse que sabe instalar (nem testei).
info
Grupo: Conde
Registrado: 29/07/13
Posts: 780
Reputação: +60
Gênero: Masculino
Char no Tibia: aguarde...

10 de maio de 2015 às 17:13
erro

10 de maio de 2015 às 17:16
Opa desculpa tenta ai.
local playerPosition = {
{x = 33607, y = 32362, z = 11},
{x = 33608, y = 32362, z = 11},
{x = 33609, y = 32362, z = 11},
{x = 33610, y = 32362, z = 11}
}
local newPosition = {
{x = 33527, y = 32331, z = 12},
{x = 33529, y = 32332, z = 12},
{x = 33528, y = 32334, z = 12},
{x = 33527, y = 32333, z = 12}
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == 22641 then
local players = {}
for _, pos in ipairs(playerPosition) do
local topPlayer = Tile(pos):getTopCreature()
if topPlayer == nil or not topPlayer:isPlayer() or topPlayer:getLevel() < 100 or topPlayer:getStorageValue(30015) ~= -1 then
return false
end
players[#players + 1] = topPlayer
end
for i, tmpPlayer in ipairs(players) do
Position(playerPosition[i]):sendMagicEffect(CONST_ME_POFF)
tmpPlayer:teleportTo(newPosition[i], false)
tmpPlayer:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA)
end
item:transform(22641)
elseif item.itemid == 22641 then
player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
end
return true
endinfo
Grupo: Conde
Registrado: 29/07/13
Posts: 780
Reputação: +60
Gênero: Masculino
Char no Tibia: aguarde...

10 de maio de 2015 às 17:59
Opa desculpa tenta ai.
local playerPosition = { {x = 33607, y = 32362, z = 11}, {x = 33608, y = 32362, z = 11}, {x = 33609, y = 32362, z = 11}, {x = 33610, y = 32362, z = 11} } local newPosition = { {x = 33527, y = 32331, z = 12}, {x = 33529, y = 32332, z = 12}, {x = 33528, y = 32334, z = 12}, {x = 33527, y = 32333, z = 12} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 22641 then local players = {} for _, pos in ipairs(playerPosition) do local topPlayer = Tile(pos):getTopCreature() if topPlayer == nil or not topPlayer:isPlayer() or topPlayer:getLevel() < 100 or topPlayer:getStorageValue(30015) ~= -1 then return false end players[#players + 1] = topPlayer end for i, tmpPlayer in ipairs(players) do Position(playerPosition[i]):sendMagicEffect(CONST_ME_POFF) tmpPlayer:teleportTo(newPosition[i], false) tmpPlayer:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA) end item:transform(22641) elseif item.itemid == 22641 then player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE)) end return true end
não foi
10 de maio de 2015 às 18:31
Você precisa trocar o id da alavanca:
de:
if item.itemid == 22641 then
para:
if item.itemid == 1945 then
de:
item:transform(22641) elseif item.itemid == 22641 then
para:
item:transform(1946) elseif item.itemid == 1946 then
Editado Maio 10 por XScupion
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

10 de maio de 2015 às 20:13
Melhor resposta
ACTIONS
nome do seu script.lua
local t = {
lvl = 100,
entrada = {
{x = 710, y = 1420, z = 5}, -- pos players
{x = 709, y = 1420, z = 5},
{x = 708, y = 1420, z = 5},
{x = 707, y = 1420, z = 5}
},
saida = {
{x = 710, y = 1420, z = 6}, -- pos para onde eles irão
{x = 709, y = 1420, z = 6},
{x = 708, y = 1420, z = 6},
{x = 707, y = 1420, z = 6}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local check = {}
for _, k in ipairs(t.entrada) do
local x = getTopCreature(k).uid
if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then
doPlayerSendCancel(cid, 'Está faltando player ou alguém não possui level '..t.lvl..' ou mais.') return true
end
table.insert(check, x)
end
for i, tid in ipairs(check) do
doSendMagicEffect(t.entrada[i], CONST_ME_POFF)
doTeleportThing(tid, t.saida[i], false)
doSendMagicEffect(t.saida[i], CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
endinfo
Grupo: Conde
Registrado: 29/07/13
Posts: 780
Reputação: +60
Gênero: Masculino
Char no Tibia: aguarde...






info
Grupo: Conde
Registrado: 29/07/13
Posts: 780
Reputação: +60
Gênero: Masculino
Char no Tibia: aguarde...
Galera queria que quando todos os players tivesse encima desses pisos e alguem puxasse a alavanca eles fossem teleportados para uma posição, mais só será possível se todos tiver encima dos pisos