• TibiaFace

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

    .
    demo menumenu

    Afiliados



    Votar:

    Ayuda script promotion

    Compartir:

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

    1Ayuda script promotion Empty Ayuda script promotion Miér Mayo 23, 2018 2:47 pm

    abbyt

    abbyt
    Nuevo Miembro
    Nuevo Miembro
    Mi Problema:
    Tengo este script que por medio de un doll, puedo cambiar de vocacion, pero me da un error al darle click al doll :/

    Código:
    local t = {
    [1] = {"You are now a master sorcerer",5},
    [2] = {"You are now an elder druid",6},
    [3] = {"You are now a royal paladin",7},
    [4] = {"You are now an elite knight",8}
    }

    function onUse(cid, item, frompos, item2, topos)
            ppos = getPlayerPosition(cid)
    local v = t[getPlayerVocation(cid)]
        if t then
        if getPlayerLevel(cid) >= 100 then
                    doPlayerSetVocation(cid,v[2])
                    doSendMagicEffect(ppos,5)
                    doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,v[1])
                    doRemoveItem(item.uid,1)
              elseif getPlayerVocation(cid) == v[2] then
                  doPlayerSendCancel(cid,"You already have this vocation")
              end
          else
              doPlayerSendCancel(cid, "You do not meet the level requirement")
          end
        return true
    end


    ERROR
    Código:
    [Error - Action Interface]
    [23/05/2018 11:39:36] data/actions/scripts/promodoll.lua:onUse
    [23/05/2018 11:39:36] Description:
    [23/05/2018 11:39:36] data/actions/scripts/promodoll.lua:17: attempt to index local 'v' (a nil value)
    [23/05/2018 11:39:36] stack traceback:
    [23/05/2018 11:39:36]    data/actions/scripts/promodoll.lua:17: in function <data/actions/scripts/promodoll.lua:8>

    gracias x su aydua


    Imagen de mi error:
    Ayuda script promotion Http:

    Esta en:
    Consola

    2 participantes

    2Ayuda script promotion Empty Re: Ayuda script promotion Miér Mayo 23, 2018 3:11 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Código:
    function onUse(cid, item, frompos, item2, topos)

    if getPlayerLevel(cid) >= 100 then
    if(isInArray({5, 6, 7, 8}, getPlayerVocation(cid))) then
    if isSorcerer(cid) then
              doPlayerSetVocation(cid, 5) 
              doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a master sorcerer.")
            elseif isDruid(cid) then
                doPlayerSetVocation(cid, 6)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now an elder druid.")
            elseif isPaladin(cid) then
                doPlayerSetVocation(cid, 7)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a royal paladin.")
            elseif isKnight(cid) then
                doPlayerSetVocation(cid, 8)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now an elite knight.")
            end
           
    else
              doPlayerSendCancel(cid, "usted ya tiene promotion")
          end
         
    else
              doPlayerSendCancel(cid, "necesitas level 100 para la promotion")
          end
        return true
    end


    ahi tienes



    Ayuda script promotion YNU5B25
    2 participantes
    http://www.tibiaface.com

    3Ayuda script promotion Empty Re: Ayuda script promotion Miér Mayo 23, 2018 5:06 pm

    abbyt

    abbyt
    Nuevo Miembro
    Nuevo Miembro
    [Admin] God Maya escribió:
    Código:
    function onUse(cid, item, frompos, item2, topos)

    if getPlayerLevel(cid) >= 100 then
    if(isInArray({5, 6, 7, 8}, getPlayerVocation(cid))) then
    if isSorcerer(cid) then
              doPlayerSetVocation(cid, 5) 
              doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a master sorcerer.")
            elseif isDruid(cid) then
                doPlayerSetVocation(cid, 6)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now an elder druid.")
            elseif isPaladin(cid) then
                doPlayerSetVocation(cid, 7)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now a royal paladin.")
            elseif isKnight(cid) then
                doPlayerSetVocation(cid, 8)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are now an elite knight.")
            end
           
    else
              doPlayerSendCancel(cid, "usted ya tiene promotion")
          end
         
    else
              doPlayerSendCancel(cid, "necesitas level 100 para la promotion")
          end
        return true
    end


    ahi tienes

    gracias bro :*

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