• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Actions] Agregar mas ids en el script

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1[Actions] Agregar mas ids en el script Empty [Actions] Agregar mas ids en el script Dom Sep 26, 2021 10:57 pm

    Morfar

    Morfar
    Miembro
    Miembro
    Descripcion escribió:Amigos que tal solicitaba nuevamente de su apoyo lo que sucede que tengo este script y me anda perfecto, su funcion es abrir puertas con 1 item, pero solamente con 1 id; es decir 1 llave abre solo 1 puerta, y me gustaria que esa llave abra mas puertas ademas de esa. aqui les dejo el script ojala me hayan entendido y puedan ayudarme es tfs 0.4 dev 8.6

    Código:
    ---Picklock System
    --By XPRIMEX
    --A HUUUUUGE thanks to Evan
    -- Edit The Ids to your pleasure :P


       function onUse(cid, item, fromPosition, itemEx, toPosition)
          local chance = math.random (1,100)
          if item.itemid == 8717 and itemEx.itemid == 7043 then
             if itemEx.actionid == 7044 then
                if chance <= 50 then
                   doTransformItem (itemEx.uid, 7044) ---Door Id
                   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The door has been unlocked !")
                   else
                   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You failed to pick the lock and broken your pick in the attempt.")
                   doPlayerRemoveItem(cid, 8717, 1)
                end
             end
          end
          return true
       end
    Imagen Explicativa escribió:Imagen Explicativa: [Actions] Agregar mas ids en el script Tibiaf10
    Version del Scripts: TFs 0.4.0

    3 participantes

    2[Actions] Agregar mas ids en el script Empty Re: [Actions] Agregar mas ids en el script Lun Sep 27, 2021 12:39 am

    akane

    akane
    Miembro
    Miembro
    colocale la action o uid a demas puertas y listo xd

    3 participantes

    Morfar

    Morfar
    Miembro
    Miembro
    ya intente y no [Actions] Agregar mas ids en el script 1f625 porque debe de llevar esta linea en aid la puerta a la que se va a transformar
    Código:
    doTransformItem (itemEx.uid, 7044) ---Door Id

    3 participantes

    4[Actions] Agregar mas ids en el script Empty Re: [Actions] Agregar mas ids en el script Lun Sep 27, 2021 10:15 pm

    akane

    akane
    Miembro
    Miembro
    y trataste de cambiarlo por otro?

    3 participantes

    Morfar

    Morfar
    Miembro
    Miembro
    BUMP!

    3 participantes

    6[Actions] Agregar mas ids en el script Empty Re: [Actions] Agregar mas ids en el script Miér Sep 29, 2021 8:44 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    podrias usar esto


    un forma de scripts en lua dando dos o mas alternativas cuando no usas una tabla para mejor entendimiento


    Código:
    if item.itemid == 8717 and itemEx.itemid == 7043 then

    asi esta tu script, ahora tu puedes hacer esto unaun sintaxis de lua llamada "or" que significa o

    veamos-lo en el lua

    Código:
    if item.itemid == 8717 and itemEx.itemid == 7043 or item.itemid == 8718 and itemEx.itemid == 7044 then

    esto es un ejemplo



    [Actions] Agregar mas ids en el script YNU5B25
    3 participantes
    http://www.tibiaface.com

    Morfar

    Morfar
    Miembro
    Miembro
    Si funciona maya gracias, pero hay manera de poderlo hacer en tabla para agregar ids de varias puertas utilizando la misma llave?

    3 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    identificame cual es la llave y cual es la puerta

    Código:
    if item.itemid == 8717 and itemEx.itemid == 7043 then



    [Actions] Agregar mas ids en el script YNU5B25
    3 participantes
    http://www.tibiaface.com

    Morfar

    Morfar
    Miembro
    Miembro
    8717 es la llave, 7043 la door cerrada, 7044 door abierta, segunda linea: 8717 es la llave, 1213 la door cerrada, 1214 door abierta.

    3 participantes

    10[Actions] Agregar mas ids en el script Empty Re: [Actions] Agregar mas ids en el script Vie Oct 01, 2021 2:45 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    aqui tienes


    Código:

    ---Picklock System
    --By XPRIMEX
    --A HUUUUUGE thanks to Evan
    -- Edit The Ids to your pleasure :P

    local doors = {2160, 5706, 2463}

      function onUse(cid, item, fromPosition, itemEx, toPosition)
          local chance = math.random (1,100)

    local newId = itemEx.itemid + 2

          if item.itemid == 8717 and isInArray(doors, itemEx.uid)E then
            if itemEx.actionid == 7044 then
                if chance <= 50 then
                  doTransformItem(itemEx.uid, newId)


                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The door has been unlocked !")
                  else
                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You failed to pick the lock and broken your pick in the attempt.")
                  doPlayerRemoveItem(cid, 8717, 1)
                end
            end
          end
          return true
      end



    prueba



    [Actions] Agregar mas ids en el script YNU5B25
    3 participantes
    http://www.tibiaface.com

    11[Actions] Agregar mas ids en el script Empty Re: [Actions] Agregar mas ids en el script Vie Oct 01, 2021 5:05 pm

    Morfar

    Morfar
    Miembro
    Miembro
    No me anda bro [Actions] Agregar mas ids en el script 1f62a
    Código:

    ---Picklock System
    --By XPRIMEX
    --A HUUUUUGE thanks to Evan
    -- Edit The Ids to your pleasure :P

    local doors = {1213, 7043, 2463}

      function onUse(cid, item, fromPosition, itemEx, toPosition)
          local chance = math.random (1,100)

    local newId = itemEx.itemid + 2

          if item.itemid == 8717 and isInArray(doors, itemEx.uid) then
            if itemEx.actionid == 7044 then
                if chance <= 50 then
                  doTransformItem(itemEx.uid, newId)


                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The door has been unlocked !")
                  else
                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You failed to pick the lock and broken your pick in the attempt.")
                  doPlayerRemoveItem(cid, 8717, 1)
                end
            end
          end
          return true
      end

    no me aparece error en la consola salvo la de la E que aparecia pero la quite

    3 participantes

    12[Actions] Agregar mas ids en el script Empty Re: [Actions] Agregar mas ids en el script Sáb Oct 02, 2021 9:12 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    pruebe

    Código:


    ---Picklock System
    --By XPRIMEX
    --A HUUUUUGE thanks to Evan
    -- Edit The Ids to your pleasure :P

    local doors = {1213, 7043, 2463}

      function onUse(cid, item, fromPosition, itemEx, toPosition)
          local chance = math.random (1,100)

    local newId = itemEx.itemid + 2

          if item.itemid == 8717 and isInArray(doors, itemEx.itemid) == TRUE then
            if itemEx.actionid == 7044 then
                if chance <= 50 then
                  doTransformItem(itemEx.uid, newId)


                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The door has been unlocked !")
                  else
                  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You failed to pick the lock and broken your pick in the attempt.")
                  doPlayerRemoveItem(cid, 8717, 1)
                end
            end
          end
          return true
      end



    [Actions] Agregar mas ids en el script YNU5B25
    3 participantes
    http://www.tibiaface.com

    13[Actions] Agregar mas ids en el script Empty Re: [Actions] Agregar mas ids en el script Sáb Oct 02, 2021 2:59 pm

    Morfar

    Morfar
    Miembro
    Miembro
    Ya lo resolvi bro muchas gracias por tu apoyo!

    3 participantes

    14[Actions] Agregar mas ids en el script Empty Re: [Actions] Agregar mas ids en el script Lun Oct 04, 2021 10:15 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Tema Resuelto



    [Actions] Agregar mas ids en el script YNU5B25
    3 participantes
    http://www.tibiaface.com

    Contenido patrocinado


    3 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).