• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    [Ayuda] [Ayuda] [Ayuda] Potions x palanca

    Compartir:

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

    Dfsuno

    Dfsuno
    Miembro
    Miembro
    Descripcion escribió:Buen dia amigos de tibiaface, me podrian ayudar con un error en un script de potions por palanca, si funciona cuando tienes dinero te da lo que te tiene que dar el problema es cuando no tienes dinero para comprar me lanza un error y me cierra el ot, actual mente estoy utilizando el otx tibiadacev4, les dejo el script en laparte de abajo si de algo sirve, gracias (y)

    Código:
    --[[ Actions Potion And Rune v2 Made FerSorc BalckTibia.org]]--
        local fertable = {
        [8016] = {2305,1200,"Firebomb",100},
        [8017] = {2278,2500,"Paralyze",100},
        [8018] = {2268,3200,"Sudden Death",100},
        [8019] = {2270,1200,"Great Manarune",100},
        [8020] = {2298,2500,"Strong Manarune",100},
        [8021] = {2307,2050,"Manarune",100},
        [8022] = {2269,3000,"Wild Growth",100},
        [8023] = {2315,2500,"Thunderstorm",100},
        [8024] = {2286,2500,"Poison Bomb",100},
        [8025] = {2293,2500,"Magic Wall Rune",100},
        [8026] = {2261,3000,"Destroy Field",100},
        [8027] = {2789,1000,"Brown Mushrooms",50},
        [8028] = {2273,1500,"Ultimate Healing Rune",20},
        [8029] = {2274,1050,"Avalanche Rune",20},
        [8030] = {2260,1000,"Blank Rune",20},
        [8031] = {2304,1200,"Grat Fireball Rune",20},
        [8032] = {2305,1500,"Firebomb Rune",20}
        }

        function onUse(cid, item, fromPosition, itemEx, toPosition)
          local f = fertable[item.actionid]
            if f then
              if doPlayerRemoveMoney(cid,f[2]) and getPlayerFreeCap(cid) >= 50 then
                doPlayerAddItem(cid,f[1],f[4])
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Purchase ".. f[3] .."")
     elseif getPlayerFreeCap(cid) <= 50 then
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "No have capacity to buy")
     elseif doPlayerRemoveMoney(cid) <= f[2] then
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Dont have money")
     
    end
              return true
            end
        end
    Imagen Explicativa escribió:Imagen Explicativa: [Ayuda] [Ayuda] [Ayuda] Potions x palanca Tibiaf10
    Version del Scripts: OTx Old Version(0.3.7)

    2 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Código:


            --[[ Actions Potion And Rune v2 Made FerSorc BalckTibia.org]]--
                local fertable = {
                [8016] = {2305,1200,"Firebomb",100},
                [8017] = {2278,2500,"Paralyze",100},
                [8018] = {2268,3200,"Sudden Death",100},
                [8019] = {2270,1200,"Great Manarune",100},
                [8020] = {2298,2500,"Strong Manarune",100},
                [8021] = {2307,2050,"Manarune",100},
                [8022] = {2269,3000,"Wild Growth",100},
                [8023] = {2315,2500,"Thunderstorm",100},
                [8024] = {2286,2500,"Poison Bomb",100},
                [8025] = {2293,2500,"Magic Wall Rune",100},
                [8026] = {2261,3000,"Destroy Field",100},
                [8027] = {2789,1000,"Brown Mushrooms",50},
                [8028] = {2273,1500,"Ultimate Healing Rune",20},
                [8029] = {2274,1050,"Avalanche Rune",20},
                [8030] = {2260,1000,"Blank Rune",20},
                [8031] = {2304,1200,"Grat Fireball Rune",20},
                [8032] = {2305,1500,"Firebomb Rune",20}
                }

                function onUse(cid, item, fromPosition, itemEx, toPosition)
                  local f = fertable[item.actionid]
                    if f then
                      if getPlayerMoney(cid) >= f[2] then
                                  if getPlayerFreeCap(cid) >= 50 then
                    doPlayerRemoveMoney(cid,f[2]) 

                        doPlayerAddItem(cid,f[1],f[4])
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Purchase ".. f[3] .."")
              else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "No have capacity to buy
           
            end
          else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Dont have money")
           
            end
                      return true
                    end
                end



    [Ayuda] [Ayuda] [Ayuda] Potions x palanca YNU5B25
    2 participantes
    http://www.tibiaface.com

    Dfsuno

    Dfsuno
    Miembro
    Miembro
    Gracias maya, lo probare (y)



    No funciono [Admin] God Maya, ahora me lanza error en la consola al abrir el server.

    >>> Loading actions... [Error - LuaInterface::loadFile] data/actions/scripts/other/potionspalanca.lua:33: unfinished string near '"No have capacity to buy'
    [Error - Event::checkScript] Cannot load script (data/actions/scripts/other/potionspalanca.lua)
    data/actions/scripts/other/potionspalanca.lua:33: unfinished string near '"No have capacity to buy'

    2 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Dfsuno escribió:Gracias maya, lo probare (y)



    No funciono [Admin] God Maya, ahora me lanza error en la consola al abrir el server.

    >>> Loading actions... [Error - LuaInterfaceFile] data/actions/scripts/other/potionspalanca.lua:33: unfinished string near '"No have capacity to buy'
    [Error - EventScript] Cannot load script (data/actions/scripts/other/potionspalanca.lua)
    data/actions/scripts/other/potionspalanca.lua:33: unfinished string near '"No have capacity to buy'

    aqui tiene

    Código:



                    --[[ Actions Potion And Rune v2 Made FerSorc BalckTibia.org]]--
                        local fertable = {
                        [8016] = {2305,1200,"Firebomb",100},
                        [8017] = {2278,2500,"Paralyze",100},
                        [8018] = {2268,3200,"Sudden Death",100},
                        [8019] = {2270,1200,"Great Manarune",100},
                        [8020] = {2298,2500,"Strong Manarune",100},
                        [8021] = {2307,2050,"Manarune",100},
                        [8022] = {2269,3000,"Wild Growth",100},
                        [8023] = {2315,2500,"Thunderstorm",100},
                        [8024] = {2286,2500,"Poison Bomb",100},
                        [8025] = {2293,2500,"Magic Wall Rune",100},
                        [8026] = {2261,3000,"Destroy Field",100},
                        [8027] = {2789,1000,"Brown Mushrooms",50},
                        [8028] = {2273,1500,"Ultimate Healing Rune",20},
                        [8029] = {2274,1050,"Avalanche Rune",20},
                        [8030] = {2260,1000,"Blank Rune",20},
                        [8031] = {2304,1200,"Grat Fireball Rune",20},
                        [8032] = {2305,1500,"Firebomb Rune",20}
                        }

                        function onUse(cid, item, fromPosition, itemEx, toPosition)
                          local f = fertable[item.actionid]
                            if f then
                              if getPlayerMoney(cid) >= f[2] then
                                          if getPlayerFreeCap(cid) >= 50 then
                            doPlayerRemoveMoney(cid,f[2]) 

                                doPlayerAddItem(cid,f[1],f[4])
                                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Purchase ".. f[3] .."")
                      else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "No have capacity to buy")
                   
                    end
                  else
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Dont have money")
                   
                    end
                              return true
                            end
                        end



    [Ayuda] [Ayuda] [Ayuda] Potions x palanca YNU5B25
    2 participantes
    http://www.tibiaface.com

    Dfsuno

    Dfsuno
    Miembro
    Miembro
    [Admin] God Maya, me sigue marcando ese error


    Código:
    >>> Loading actions... [Error - LuaInterface::loadFile] data/actions/scripts/other/potionspalanca.lua:32: unfinished string near '"No have capacity to buy'
    [Error - Event::checkScript] Cannot load script (data/actions/scripts/other/potionspalanca.lua)
    data/actions/scripts/other/potionspalanca.lua:32: unfinished string near '"No have capacity to buy'


    Aquí dejo el error que me da con el script que postie al principio, cuando le doy ala palanca sin sin dinero( lo abri desde otra consola en otx, me cierra el ot)


    Código:
    [26/01/2020 16:37:47] [Error - Action Interface]
    [26/01/2020 16:37:47] data/actions/scripts/other/potionspalanca.lua:onUse
    [26/01/2020 16:37:47] Description:
    [26/01/2020 16:37:47] (luaDoPlayerRemoveMoney) Player not found

    [26/01/2020 16:37:47] [Error - Action Interface]
    [26/01/2020 16:37:47] data/actions/scripts/other/potionspalanca.lua:onUse
    [26/01/2020 16:37:47] Description:
    [26/01/2020 16:37:47] data/actions/scripts/other/potionspalanca.lua:30: attempt to compare boolean with number
    [26/01/2020 16:37:47] stack traceback:
    [26/01/2020 16:37:47]    data/actions/scripts/other/potionspalanca.lua:30: in function <data/actions/scripts/other/potionspalanca.lua:22>

    2 participantes

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Dfsuno escribió:[Admin] God Maya, me sigue marcando ese error


    Código:
    >>> Loading actions... [Error - LuaInterface::loadFile] data/actions/scripts/other/potionspalanca.lua:32: unfinished string near '"No have capacity to buy'
    [Error - Event::checkScript] Cannot load script (data/actions/scripts/other/potionspalanca.lua)
    data/actions/scripts/other/potionspalanca.lua:32: unfinished string near '"No have capacity to buy'


    Aquí dejo el error que me da con el script que postie al principio, cuando le doy ala palanca sin sin dinero( lo abri desde otra consola en otx, me cierra el ot)


    Código:
    [26/01/2020 16:37:47] [Error - Action Interface]
    [26/01/2020 16:37:47] data/actions/scripts/other/potionspalanca.lua:onUse
    [26/01/2020 16:37:47] Description:
    [26/01/2020 16:37:47] (luaDoPlayerRemoveMoney) Player not found

    [26/01/2020 16:37:47] [Error - Action Interface]
    [26/01/2020 16:37:47] data/actions/scripts/other/potionspalanca.lua:onUse
    [26/01/2020 16:37:47] Description:
    [26/01/2020 16:37:47] data/actions/scripts/other/potionspalanca.lua:30: attempt to compare boolean with number
    [26/01/2020 16:37:47] stack traceback:
    [26/01/2020 16:37:47]    data/actions/scripts/other/potionspalanca.lua:30: in function <data/actions/scripts/other/potionspalanca.lua:22>

    parece que no has cambiado el scripts el mismo error



    [Ayuda] [Ayuda] [Ayuda] Potions x palanca YNU5B25
    2 participantes
    http://www.tibiaface.com

    Dfsuno

    Dfsuno
    Miembro
    Miembro
    Very Happy Resuelto Gracias Very Happy

    2 participantes

    Contenido patrocinado


    2 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).