• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    ayuda con este script

    Compartir:

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

    1Resuelto ayuda con este script Vie Mayo 15, 2015 1:12 am

    ijuchia

    ijuchia
    Miembro
    Miembro
    Disculpen me podrian ayudar con este action script de random items
    me marca este error en la consola

    [Warning - EventScript] Can not load script: scripts/valuables/random box.lua
    data/actions/scripts/valuables/random box.lua:67: '=' expected near 'or'


    Código:
    local config = {
     [23908] = { -- random box
     chances = {
    --amulet and others
     {from = 1, to = 3000, itemId = 2160, count = 10},
     {from = 3001, to = 4000, itemId = 23874},
     {from = 3001, to = 4000, itemId = 23882},
     {from = 3001, to = 4000, itemId = 23890},
     {from = 3001, to = 4000, itemId = 23896},
     {from = 3001, to = 4000, itemId = 18408},
     {from = 3001, to = 4000, itemId = 18407},
     {from = 3001, to = 4000, itemId = 9693},
     {from = 3001, to = 4000, itemId = 6579},
    --helmet
     {from = 4001, to = 7085, itemId = 23875},
     {from = 4001, to = 7085, itemId = 23884},
     {from = 4001, to = 7085, itemId = 23891},
     {from = 4001, to = 7085, itemId = 23868},
    --armor
     {from = 7086, to = 8000, itemId = 23869},
     {from = 7086, to = 8000, itemId = 23876},
     {from = 7086, to = 8000, itemId = 23885},
     {from = 7086, to = 8000, itemId = 23892},
    --legs
     {from = 7086, to = 8000, itemId = 23893},
     {from = 7086, to = 8000, itemId = 23870},
     {from = 7086, to = 8000, itemId = 23877},
     {from = 7086, to = 8000, itemId = 23886},
    --boots
     {from = 7086, to = 8000, itemId = 23887},
     {from = 7086, to = 8000, itemId = 23878},
     {from = 7086, to = 8000, itemId = 23894},
     {from = 7086, to = 8000, itemId = 23871},
    --shield
     {from = 7086, to = 8000, itemId = 23900},
     {from = 7086, to = 8000, itemId = 23873},
     {from = 7086, to = 8000, itemId = 23880},
     {from = 7086, to = 8000, itemId = 23888},
    --weapons
     {from = 8001, to = 9499, itemId = 23872},
     {from = 8001, to = 9499, itemId = 23879},
     {from = 8001, to = 9499, itemId = 23881},
     {from = 8001, to = 9499, itemId = 23883},
     {from = 8001, to = 9499, itemId = 23889},
     {from = 8001, to = 9499, itemId = 23895},
     {from = 8001, to = 9499, itemId = 23897},
     {from = 8001, to = 9499, itemId = 23898},
    --promotion scroll
     {from = 9500, to = 10001, itemId = 23905}
     },

     effect = CONST_ME_CRAPS
     }
    }

    function onUse(player, item, fromPosition, target, toPosition, isHotkey)
     local useId = config[item.itemid]
     if not useId then
     return false
     end

     local chance = math.random(10001)
     for i = 1, #useId.chances do
     local randomItem = useId.chances[i]
     if chance >= randomItem.from and chance <= randomItem.to then
     if randomItem.itemId then
     local itemId randomItem.itemId, randomItem.count or 1
     player:addItem(itemId, count)
     if item.itemid = 23908 then
     local itemType = ItemType(itemId)
     player:say('You found ' .. (count > 1 and count or (itemType:getArticle() ~= '' and itemType:getArticle() or '')) .. ' ' .. (count > 1 and itemType:getPluralName() or itemType:getName()) .. ' in the bag.', TALKTYPE_MONSTER_SAY)
     end
     else
     player:say('You found nothing useful.', TALKTYPE_MONSTER_SAY)
     end

     item:getPosition():sendMagicEffect(useId.effect)
     item:remove(1)
     break
     end
     end
     return true
    end

    2 participantes

    2Resuelto Re: ayuda con este script Sáb Mayo 16, 2015 1:51 am

    ijuchia

    ijuchia
    Miembro
    Miembro
    dare un bump espero no ser mal educado

    2 participantes

    3Resuelto Re: ayuda con este script Sáb Mayo 16, 2015 3:18 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    prueba


    Código:
                local config = {
                   [23908] = { -- random box
                      chances = {
                --amulet and others
                         {from = 1, to = 3000, itemId = 2160, count = 10},
                         {from = 3001, to = 4000, itemId = 23874},
                         {from = 3001, to = 4000, itemId = 23882},
                         {from = 3001, to = 4000, itemId = 23890},
                         {from = 3001, to = 4000, itemId = 23896},
                         {from = 3001, to = 4000, itemId = 18408},
                         {from = 3001, to = 4000, itemId = 18407},
                         {from = 3001, to = 4000, itemId = 9693},
                         {from = 3001, to = 4000, itemId = 6579},
                --helmet
                         {from = 4001, to = 7085, itemId = 23875},
                         {from = 4001, to = 7085, itemId = 23884},
                         {from = 4001, to = 7085, itemId = 23891},
                         {from = 4001, to = 7085, itemId = 23868},
                --armor
                         {from = 7086, to = 8000, itemId = 23869},
                         {from = 7086, to = 8000, itemId = 23876},
                         {from = 7086, to = 8000, itemId = 23885},
                         {from = 7086, to = 8000, itemId = 23892},
                --legs
                         {from = 7086, to = 8000, itemId = 23893},
                         {from = 7086, to = 8000, itemId = 23870},
                         {from = 7086, to = 8000, itemId = 23877},
                         {from = 7086, to = 8000, itemId = 23886},
                --boots
                         {from = 7086, to = 8000, itemId = 23887},
                         {from = 7086, to = 8000, itemId = 23878},
                         {from = 7086, to = 8000, itemId = 23894},
                         {from = 7086, to = 8000, itemId = 23871},
                --shield
                         {from = 7086, to = 8000, itemId = 23900},
                         {from = 7086, to = 8000, itemId = 23873},
                         {from = 7086, to = 8000, itemId = 23880},
                         {from = 7086, to = 8000, itemId = 23888},
                --weapons
                         {from = 8001, to = 9499, itemId = 23872},
                         {from = 8001, to = 9499, itemId = 23879},
                         {from = 8001, to = 9499, itemId = 23881},
                         {from = 8001, to = 9499, itemId = 23883},
                         {from = 8001, to = 9499, itemId = 23889},
                         {from = 8001, to = 9499, itemId = 23895},
                         {from = 8001, to = 9499, itemId = 23897},
                         {from = 8001, to = 9499, itemId = 23898},
                --promotion scroll
                         {from = 9500, to = 10001, itemId = 23905}
                      },

                      effect = CONST_ME_CRAPS
                   }
                }

                function onUse(player, item, fromPosition, target, toPosition, isHotkey)
                   local useId = config[item.itemid]
                   if not useId then
                      return false
                   end

                   local chance = math.random(10001)
                   for i = 1, #useId.chances do
                      local randomItem = useId.chances[i]
                      if chance >= randomItem.from and chance <= randomItem.to then
                         if randomItem.itemId then
                           local itemId, count = randomItem.itemId, randomItem.count or 1
                            player:addItem(itemId, count)
                            if item.itemid == 23908 then
                               local itemType = ItemType(itemId)
                               player:say('You found ' .. (count > 1 and count or (itemType:getArticle() ~= '' and itemType:getArticle() or '')) .. ' ' .. (count > 1 and itemType:getPluralName() or itemType:getName()) .. ' in the bag.', TALKTYPE_MONSTER_SAY)
                            end
                         else
                            player:say('You found nothing useful.', TALKTYPE_MONSTER_SAY)
                         end

                         item:getPosition():sendMagicEffect(useId.effect)
                         item:remove(1)
                         break
                      end
                   end
                   return true
                end



    ayuda con este script YNU5B25
    2 participantes
    http://www.tibiaface.com

    4Resuelto Re: ayuda con este script Dom Mayo 17, 2015 1:30 am

    ijuchia

    ijuchia
    Miembro
    Miembro
    muchass graciass me funciono ^^

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