• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    problemas con monturas

    Compartir:

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

    1default problemas con monturas Mar Abr 20, 2021 12:19 pm

    Nemesis811

    Nemesis811
    Miembro
    Miembro
    Descripcion escribió:tengo un problema con mis monturas no me deja usar los items en las creaturas me sale esto en la consola mi otserver es 8.70
    Código:

    [12:5:56.263] [Error - Action Interface]
    [12:5:56.264] data/actions/scripts/other/taming.lua:onUse
    [12:5:56.268] Description:
    [12:5:56.269] data/actions/scripts/other/taming.lua:47: attempt to call global 'Player' (a nil value)
    [12:5:56.270] stack traceback:
    [12:5:56.271]   data/actions/scripts/other/taming.lua:47: in function <data/actions/scripts/other/taming.lua:46>


    en taming lua tengo esto

    local ACTION_RUN, ACTION_BREAK, ACTION_NONE, ACTION_ALL = 1, 2, 3, 4
    local TYPE_MONSTER, TYPE_NPC, TYPE_ACTION, TYPE_UNIQUE = 1, 2, 3, 4

    local config = {
            [5907] =        {NAME = 'Bear',                                 ID = 3,         TYPE = TYPE_MONSTER,    CHANCE = 20,    FAIL_MSG = { {1, "The bear ran away."}, {2, "Oh no! The slingshot broke."}, {3, "The bear is trying to hit you with its claws."} }, SUCCESS_MSG = "You have tamed the bear."},
            [13295] =       {NAME = 'Black Sheep',                  ID = 4,         TYPE = TYPE_MONSTER,    CHANCE = 25,    FAIL_MSG = { {1, "The black sheep ran away."}, {2, "Oh no! The reins were torn."}, {3, "The black sheep is trying to run away."} }, SUCCESS_MSG = "You have tamed the sheep."},
            [13293] =       {NAME = 'Midnight Panther',             ID = 5,         TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The panther has escaped."}, {2, "The whip broke."} }, SUCCESS_MSG = "You have tamed the panther."},
            [13298] =       {NAME = 'Terror Bird',                  ID = 2,         TYPE = TYPE_MONSTER,    CHANCE = 15,    FAIL_MSG = { {1, "The bird ran away."}, {3, "The terror bird is pecking you."} }, SUCCESS_MSG = "You have tamed the bird."},
            [13247] =       {NAME = 'Boar',                                 ID = 10,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The boar has run away"}, {3, "The boar attacks you."} }, SUCCESS_MSG = "You have tamed the boar."},
            [13305] =       {NAME = 'Crustacea Gigantica',  ID = 7,         TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The crustacea has run away."}, {2, "The crustacea ate the shrimp."} }, SUCCESS_MSG = "You have tamed the crustacea."},
            [13291] =       {NAME = 'Undead Cavebear',              ID = 12,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The undead bear has run away."} }, SUCCESS_MSG = "You have tamed the skeleton."},
            [13307] =       {NAME = 'Wailing Widow',                ID = 1,         TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The widow has run away."}, {2, "The widow has eaten the sweet bait."} }, SUCCESS_MSG = "You have tamed the widow."},
            [13292] =       {NAME = 'Tin Lizzard',                  ID = 8,         TYPE = TYPE_NPC,                CHANCE = 40,    FAIL_MSG = { {2, "The key broke inside."} }, SUCCESS_MSG = "You have started the Tin Lizzard!"},
            [13294] =       {NAME = 'Draptor',                      ID = 6,         TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The draptor has run away."}, {3, "The draptor has fled."} }, SUCCESS_MSG = "You have tamed the draptor."},
            [13536] =       {NAME = 'Crystal Wolf',                 ID = 16,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The wolf has run away."} }, SUCCESS_MSG = "You have tamed the wolf."},
            [13539] =       {NAME = 'White Deer',                   ID = 18,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {2, "The cone broke."}, {3, "The deer has fled in fear."} }, SUCCESS_MSG = "You have tamed the deer."},
            [13538] =       {NAME = 'Panda',                                ID = 19,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {4, "Panda ate the leaves and ran away."} }, SUCCESS_MSG = "You have tamed the panda."},
            [13535] =       {NAME = 'Dromedary',                    ID = 20,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "Dromedary has run away."} }, SUCCESS_MSG = "You have tamed the dromedary."},
            [13498] =       {NAME = 'Sandstone Scorpion',   ID = 21,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The scorpion has vanished."}, {2, "Scorpion broken the sceptre."} }, SUCCESS_MSG = "You have tamed the scorpion"},
            [13537] =       {NAME = 'Donkey',                       ID = 13,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The witch has escaped!"} }, SUCCESS_MSG = "You have tamed the mule."},
            [13938] =       {NAME = 'Uniwheel',                     ID = 15,        TYPE = TYPE_NPC,                CHANCE = 40,    FAIL_MSG = { {2, "The oil is having no effect."} }, SUCCESS_MSG = "You have found an Uniwheel."},
            [13508] =       {NAME = 'Slug',                                 ID = 14,        TYPE = TYPE_MONSTER,    CHANCE = 40,    FAIL_MSG = { {1, "The slug has run away."}, {3, "The drug had no effect."} }, SUCCESS_MSG = "You have tamed the slug."},
            [13939] =       {NAME = 'War Horse',                    ID = 23,        TYPE = TYPE_MONSTER,    CHANCE = 15,    FAIL_MSG = { {1, "The horse runs away."}, {2, "The horse ate the oats."} }, SUCCESS_MSG = "You have tamed the horse."},
            [15545] =       {NAME = 'Manta Ray',                    ID = 28,        TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, "The manta ray fled."}, {3, "The manta ray is trying to escape."} }, SUCCESS_MSG = "You have tamed the manta ray."},
            [15546] =       {NAME = 'Lady Bug',                      ID = 27,        TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, "The ladybug got scared and ran away."}, {3, "The ladybug is trying to nibble."} }, SUCCESS_MSG = "You tame a ladybug."},
            [20138] =       {NAME = 'Water Buffalo',                ID = 35,        TYPE = TYPE_MONSTER,    CHANCE = 30,    FAIL_MSG = { {1, "The water buffalo got scared and ran away."}, {3, "The water buffalo is trying to nibble."} }, SUCCESS_MSG = "You tamed a water buffalo."}
    }

    local function doFailAction(cid, mount, pos, item, itemEx)
            local action, effect = mount.FAIL_MSG[math.random(1, table.maxn(mount.FAIL_MSG))], CONST_ME_POFF
            if(action[1] == ACTION_RUN) then
          Creature(itemEx.uid):remove()
            elseif(action[1] == ACTION_BREAK) then
                    effect = CONST_ME_BLOCKHIT
          Item(item.uid):remove(1)
            elseif(action[1] == ACTION_ALL) then
                    Creature(itemEx.uid):remove()
          Item(item.uid):remove(1)
            end

       Position(pos):sendMagicEffect(effect)
       Player(cid):say(action[2], TALKTYPE_ORANGE_1)
            return action
    end

    function onUse(cid, item, fromPosition, itemEx, toPosition)
       local player = Player(cid)
       local monster = Monster(itemEx.uid)
       local npc = Npc(itemEx.uid)
            local mount = config[item.itemid]
            if mount == nil or player:hasMount(mount.ID) then
                    return false
            end

            local rand = math.random(1, 100)
            --Monster Mount
            if monster ~= nil and mount.TYPE == TYPE_MONSTER then
          if Creature(itemEx.uid):getMaster() then
             player:say("You cant tame a summon!", TALKTYPE_ORANGE_1)
             return true
          end
                    if mount.NAME == monster:getName() then
                            if rand > mount.CHANCE then
                                    doFailAction(cid, mount, toPosition, item, itemEx)
                                    return true
                            end

             player:addMount(mount.ID)
             player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG)

             player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1)
             monster:remove()

             toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
             Item(item.uid):remove(1)
                            return true
                    end
            --NPC Mount
            elseif npc ~= nil and mount.TYPE == TYPE_NPC then
                    if mount.NAME == npc:getName() then
                            if rand > mount.CHANCE then
                                    doFailAction(cid, mount, toPosition, item, itemEx)
                                    return true
                            end

             player:addMount(mount.ID)
             player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG)

             player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1)

             toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
             Item(item.uid):remove(1)
                            return true
                    end
            --Action Mount
            elseif itemEx.actionid > 0 and mount.TYPE == TYPE_ACTION then
                    if(mount.NAME == itemEx.actionid) then
                            if rand > mount.CHANCE then
                                    doFailAction(cid, mount, toPosition, item, itemEx)
                                    return true
                            end
             player:addMount(mount.ID)
             player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG)

             player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1)

             toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
             Item(item.uid):remove(1)
                            return true
                    end
            --Unique Mount
            elseif itemEx.uid <= 65535 and mount.TYPE == TYPE_UNIQUE then
                    if mount.NAME == itemEx.uid then
                            if rand > mount.CHANCE then
                                    doFailAction(cid, mount, toPosition, item, itemEx)
                                    return true
                            end

             player:addMount(mount.ID)
             player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, mount.SUCCESS_MSG)

             player:say(mount.SUCCESS_MSG, TALKTYPE_ORANGE_1)

             toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
             Item(item.uid):remove(1)
                            return true
                    end
            end
            return false
    end

    y en actions xml esto

          <action itemid="5907" script="other/taming.lua"/>
          <action itemid="13295" script="other/taming.lua"/>
          <action itemid="13293" script="other/taming.lua"/>
          <action itemid="13298" script="other/taming.lua"/>
          <action itemid="13247" script="other/taming.lua"/>
          <action itemid="13305" script="other/taming.lua"/>
          <action itemid="13291" script="other/taming.lua"/>
          <action itemid="13307" script="other/taming.lua"/>
          <action itemid="13292" script="other/taming.lua"/>
          <action itemid="13294" script="other/taming.lua"/>

    espero su respuesta por favor y su maxima colaboracion amigos

    Captura del Error escribió:Imagen del error: problemas con monturas Empty
    El error radica en: Consola



    o si me dan un script como el de addon doll que yo escoja el item para obtener una montura que cuando uno le de use como la comida me de la montura

    2default Re: problemas con monturas Mar Abr 20, 2021 5:37 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    esto no te sirve por que esto solo es para tfs 1.3

    usa este

    Código:

    --taming monsters by ruda from otland
    local function tameMonster(cid, item, itemEx, tame, run, broken)
       n = math.random(100)
       if n <= broken then
          doCreatureSay(cid, "Lost item", TALKTYPE_ORANGE_1)
          doRemoveItem(item.uid)
       elseif n > broken and n <= (tame+broken) then
          doRemoveItem(item.uid)
          doCreatureSay(cid, "You tamed", TALKTYPE_ORANGE_1)
          doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You tamed "..getCreatureName(itemEx.uid)..".")
          return true
       elseif n > (tame+broken) and n <= (tame+broken+run) then
          doCreatureSay(cid, "Fled", TALKTYPE_ORANGE_1)
          doRemoveCreature(itemEx.uid)
       else
          doCreatureSay(cid, "Try again", TALKTYPE_ORANGE_1)
       end
       return false
    end

    local function inArray(table, value)
       for i,v in pairs(table) do
          if (v.name == string.lower(value)) then
             return i
          end
       end
       return 0
    end

    local mounts = {
       {item = 13322, name = "wailing widow", id = 1,          tame=10, run=39, broken=51},
       {item = 13313, name = "terror bird", id = 2,          tame=10, run=39, broken=51},
       {item = 5907, name = "bear", id = 3,             tame=7, run=39, broken=54},
       {item = 13310, name = "black sheep", id = 4,          tame=7, run=35, broken=58},
       {item = 13308, name = "midnight panther", id = 5,       tame=10, run=39, broken=51},
       {item = 13309, name = "draptor", id = 6,             tame=10, run=39, broken=51},
       {item = 13320, name = "crustacea gigantica", id = 7,    tame=10, run=39, broken=51},
       {item = 13262, name = "boar", id = 10,                tame=10, run=39, broken=51},
       {item = 13306, name = "undead cavebear", id = 12,       tame=10, run=39, broken=51}
    }

    function onUse(cid, item, fromPosition, itemEx, toPosition)
       if isCreature(itemEx.uid) then
          if inArray(mounts, getCreatureName(itemEx.uid)) > 0 then
             i = inArray(mounts, getCreatureName(itemEx.uid))
             if item.itemid == mounts[i].item and not getPlayerMount(cid, mounts[i].id) then
                if tameMonster(cid, item, itemEx, mounts[i].tame, mounts[i].run, mounts[i].broken) then
                   doSendMagicEffect(fromPosition, CONST_ME_MAGIC_BLUE)
                   doRemoveCreature(itemEx.uid)
                   doPlayerAddMount(cid, mounts[i].id)
                else
                   doSendMagicEffect(toPosition, CONST_ME_POFF)
                end
             end
          end
       end
       return true
    end

    Código:

    <action itemid="13310" script="mounts.lua"/> --reins
       <action itemid="13309" script="mounts.lua"/> --harness
       <action itemid="13308" script="mounts.lua"/> --leather whip
       <action itemid="13313" script="mounts.lua"/> --carrot on a stick
       <action itemid="13262" script="mounts.lua"/> --hunting horn
       <action itemid="13320" script="mounts.lua"/> --Giant Shrimp
       <action itemid="13306" script="mounts.lua"/> --Maxilla Maximus
       <action itemid="5907" script="mounts.lua"/> --Slingshot
       <action itemid="13322" script="mounts.lua"/> --Sweet Smelling Bait



    problemas con monturas YNU5B25
    https://www.tibiaface.com

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