Ir para conteúdo
  • 0

Sistema de Ponte com Alavancas


ADM Hanzo

Pergunta

Meu primeiro post no fórum, queria antes de mais nada já ir pedindo desculpas caso o tópico se encontrar no lugar errado.
Venho por meio desse tópico para pedir a ajuda de vocês com um probleminha que estou tendo com pontes, ao puxar a alavanca a ponte sobe, porem se tiver player na ponte ele fica em cima do rio.
Alguém poderia me ajudar ?

Tibia 8.6
Script Abaixo
"

local bridgepos = {x=32410, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos2 = {x=32410, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos3 = {x=32411, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos4 = {x=32411, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local frompos = {x=32409, y=32231, z=10,}
local splash = {x=32413, y=32230, z=10, stackpos=1} -- Position of the liquid pool

local leverUID = 15004 -- Unique ID of the lever
local liquidId = 4611 -- Item ID of the liquid pool
local liquidType = 0 -- Subtype of the liquid pool

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

local bridge = getThingfromPos(bridgepos)
local bridge2 = getThingfromPos(bridgepos2)
local bridge3 = getThingfromPos(bridgepos3)
local bridge4 = getThingfromPos(bridgepos4)


local liquid = getThingfromPos(splash)

        if item.uid == leverUID and item.itemid == 1946 and bridge.itemid == 5769  then
                doTransformItem(bridge.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945) 
end
       if item.uid == leverUID and item.itemid == 1945 and bridge.itemid == 4611 then
        doTransformItem(bridge.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge2.itemid == 5769 then
                doTransformItem(bridge2.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge2.itemid == 4611 then
        doTransformItem(bridge2.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge3.itemid == 5769 then
                doTransformItem(bridge3.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge3.itemid == 4611 then
        doTransformItem(bridge3.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge4.itemid == 5769 then
                doTransformItem(bridge4.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge4.itemid == 4611 then
        doTransformItem(bridge4.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        return TRUE
end

 

"

 

Editado por ADM Hanzo
Link para o comentário
Compartilhar em outros sites

8 respostass a esta questão

Posts Recomendados

  • 0

tenta isso

 

getThingfromPos(player2pos)

local bridgepos = {x=32410, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos2 = {x=32410, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos3 = {x=32411, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos4 = {x=32411, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local frompos = {x=32409, y=32231, z=10}
local splash = {x=32413, y=32230, z=10, stackpos=1} -- Position of the liquid pool

local leverUID = 15004 -- Unique ID of the lever
local liquidId = 4611 -- Item ID of the liquid pool
local liquidType = 0 -- Subtype of the liquid pool

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

local bridge = getThingfromPos(bridgepos)
local bridge2 = getThingfromPos(bridgepos2)
local bridge3 = getThingfromPos(bridgepos3)
local bridge4 = getThingfromPos(bridgepos4)


local liquid = getThingfromPos(splash)

 if isPlayer((getThingFromPos(bridgepos).uid) or (getThingFromPos(bridgepos2).uid) or (getThingFromPos(bridgepos3).uid) or (getThingFromPos(bridgepos4).uid)) then
   doTeleportThing(getThingFromPos(bridgepos).uid,frompos)
  end

        if item.uid == leverUID and item.itemid == 1946 and bridge.itemid == 5769  then
                doTransformItem(bridge.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945) 
end
       if item.uid == leverUID and item.itemid == 1945 and bridge.itemid == 4611 then
        doTransformItem(bridge.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge2.itemid == 5769 then
                doTransformItem(bridge2.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge2.itemid == 4611 then
        doTransformItem(bridge2.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge3.itemid == 5769 then
                doTransformItem(bridge3.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge3.itemid == 4611 then
        doTransformItem(bridge3.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge4.itemid == 5769 then
                doTransformItem(bridge4.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge4.itemid == 4611 then
        doTransformItem(bridge4.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        return TRUE
end

 

Link para o comentário
Compartilhar em outros sites

  • 0
20 horas atrás, Session Start disse:

tenta isso

 


getThingfromPos(player2pos)

local bridgepos = {x=32410, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos2 = {x=32410, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos3 = {x=32411, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos4 = {x=32411, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local frompos = {x=32409, y=32231, z=10}
local splash = {x=32413, y=32230, z=10, stackpos=1} -- Position of the liquid pool

local leverUID = 15004 -- Unique ID of the lever
local liquidId = 4611 -- Item ID of the liquid pool
local liquidType = 0 -- Subtype of the liquid pool

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

local bridge = getThingfromPos(bridgepos)
local bridge2 = getThingfromPos(bridgepos2)
local bridge3 = getThingfromPos(bridgepos3)
local bridge4 = getThingfromPos(bridgepos4)


local liquid = getThingfromPos(splash)

 if isPlayer((getThingFromPos(bridgepos).uid) or (getThingFromPos(bridgepos2).uid) or (getThingFromPos(bridgepos3).uid) or (getThingFromPos(bridgepos4).uid)) then
   doTeleportThing(getThingFromPos(bridgepos).uid,frompos)
  end

        if item.uid == leverUID and item.itemid == 1946 and bridge.itemid == 5769  then
                doTransformItem(bridge.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945) 
end
       if item.uid == leverUID and item.itemid == 1945 and bridge.itemid == 4611 then
        doTransformItem(bridge.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge2.itemid == 5769 then
                doTransformItem(bridge2.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge2.itemid == 4611 then
        doTransformItem(bridge2.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge3.itemid == 5769 then
                doTransformItem(bridge3.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge3.itemid == 4611 then
        doTransformItem(bridge3.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge4.itemid == 5769 then
                doTransformItem(bridge4.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge4.itemid == 4611 then
        doTransformItem(bridge4.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        return TRUE
end

 

Não funcionou e agora a ponte não está levantando mais também.

Link para o comentário
Compartilhar em outros sites

  • 0
1 minuto atrás, Session Start disse:

Posta o log do erro...

seria isso ?
[31/03/2019 15:29:49] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/alavanca_subsolothais.lua)

Link para o comentário
Compartilhar em outros sites

  • 0
local bridgepos = {x=32410, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos2 = {x=32410, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos3 = {x=32411, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos4 = {x=32411, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local frompos = {x=32409, y=32231, z=10}
local splash = {x=32413, y=32230, z=10, stackpos=1} -- Position of the liquid pool

local leverUID = 15004 -- Unique ID of the lever
local liquidId = 4611 -- Item ID of the liquid pool
local liquidType = 0 -- Subtype of the liquid pool

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

local bridge = getThingfromPos(bridgepos)
local bridge2 = getThingfromPos(bridgepos2)
local bridge3 = getThingfromPos(bridgepos3)
local bridge4 = getThingfromPos(bridgepos4)


local liquid = getThingfromPos(splash)

 if isPlayer((getThingFromPos(bridgepos).uid) or (getThingFromPos(bridgepos2).uid) or (getThingFromPos(bridgepos3).uid) or (getThingFromPos(bridgepos4).uid)) then
   doTeleportThing(getThingFromPos(bridgepos).uid,frompos)
  end

        if item.uid == leverUID and item.itemid == 1946 and bridge.itemid == 5769  then
                doTransformItem(bridge.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945) 
end
       if item.uid == leverUID and item.itemid == 1945 and bridge.itemid == 4611 then
        doTransformItem(bridge.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge2.itemid == 5769 then
                doTransformItem(bridge2.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge2.itemid == 4611 then
        doTransformItem(bridge2.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge3.itemid == 5769 then
                doTransformItem(bridge3.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge3.itemid == 4611 then
        doTransformItem(bridge3.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge4.itemid == 5769 then
                doTransformItem(bridge4.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge4.itemid == 4611 then
        doTransformItem(bridge4.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        return TRUE
end

tinha uma linha errada no inicio, tenta isso, caso dê erro, manda o log novamente...

Link para o comentário
Compartilhar em outros sites

  • 0

 

local bridgepos = {x=32410, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos2 = {x=32410, y=32232, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos3 = {x=32411, y=32231, z=10, stackpos=0 } -- Position of the bridge tile
local bridgepos4 = {x=32411, y=32232, z=10, stackpos=0 } -- Position of the bridge tile

local bridgeposCheck = {x=32410, y=32231, z=10}
local bridgepos2Check = {x=32411, y=32232, z=10} 
local jogaPlayerMonstro = {x=32409, y=32231, z=10}

local frompos = {x=32409, y=32231, z=10}
local splash = {x=32413, y=32230, z=10, stackpos=1} -- Position of the liquid pool

local leverUID = 15004 -- Unique ID of the lever
local liquidId = 4611 -- Item ID of the liquid pool
local liquidType = 0 -- Subtype of the liquid pool

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

local bridge = getThingfromPos(bridgepos)
local bridge2 = getThingfromPos(bridgepos2)
local bridge3 = getThingfromPos(bridgepos3)
local bridge4 = getThingfromPos(bridgepos4)


local liquid = getThingfromPos(splash)

for x = bridgeposCheck.x, bridgepos2Check.x do
 for y = bridgeposCheck.y, bridgepos2Check.y do
  if isMonster(getThingFromPos({x=x, y=y, z=bridgeposCheck.z, stackpos=253}).uid) then
   doTeleportThing(getThingFromPos({x=x, y=y, z=bridgeposCheck.z, stackpos=253}).uid,jogaPlayerMonstro)
  end
 end
end

for x = bridgeposCheck.x, bridgepos2Check.x do
 for y = bridgeposCheck.y, bridgepos2Check.y do
  if isPlayer(getThingFromPos({x=x, y=y, z=bridgeposCheck.z, stackpos=253}).uid) then
    doTeleportThing(getThingFromPos({x=x, y=y, z=bridgeposCheck.z, stackpos=253}).uid,jogaPlayerMonstro)
  end
 end
end

        if item.uid == leverUID and item.itemid == 1946 and bridge.itemid == 5769  then
                doTransformItem(bridge.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945) 
end
       if item.uid == leverUID and item.itemid == 1945 and bridge.itemid == 4611 then
        doTransformItem(bridge.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge2.itemid == 5769 then
                doTransformItem(bridge2.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge2.itemid == 4611 then
        doTransformItem(bridge2.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge3.itemid == 5769 then
                doTransformItem(bridge3.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge3.itemid == 4611 then
        doTransformItem(bridge3.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        if item.uid == leverUID and item.itemid == 1946 and bridge4.itemid == 5769 then
                doTransformItem(bridge4.uid, 4611)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1945)
end
       if item.uid == leverUID and item.itemid == 1945 and bridge4.itemid == 4611 then
        doTransformItem(bridge4.uid, 5769)
                doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
                doTransformItem(item.uid, 1946)
end
        return TRUE
end

 

Editado por Session Start
Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...