Ir para conteúdo

Featured Replies

Postado
  • Autor
local config = {
                [1] = {
                                --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
                                items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
                                --container rope, shovel, mana potion
                                container = {{2120, 1}, {2554, 1}, {7620, 1}}
                },
                [2] = {
                                --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
                                items = {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
                                --container rope, shovel, mana potion
                                container = {{2120, 1}, {2554, 1}, {7620, 1}}
                },
                [3] = {
                                --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
                                items = {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}},
                                --container rope, shovel, health potion, bow, 50 arrow
                                container = {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}}
                },
                [4] = {
                                --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
                                items = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
                                --container jagged sword, daramian mace, rope, shovel, health potion
                                container = {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}}
                }
}
 
function onLogin(cid)
        local player = Player(cid)
        local targetVocation = config[player:getVocation():getId()]
        if not targetVocation then
                return true
        end
 
        if player:getLastLoginSaved() ~= 0 then
                return true
        end
 
        for i = 1, #targetVocation.items do
                player:addItem(targetVocation.items[1], targetVocation.items[2])
        end
 
        local backpack = player:addItem(1988)
        if not backpack then
                return true
        end
 
        for i = 1, #targetVocation.container do
                backpack:addItem(targetVocation.container[1], targetVocation.container[2])
        end
        return true
       
        player:registerEvent("FirstItems")
end
  • Respostas 12
  • Visualizações 607
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Bruno Carvalho
    Bruno Carvalho

    Com o tfs 1.0+ você deve adicionar somente em creaturescripts... Em creaturescripts/scripts crie um arquivo chamado firstitems.lua edite e coloque no arquivo: [paste]Hj98AQNP[/paste]   Edite o arq

  • antes da pasta data em Mods tem um arquivo chamado firstitems.lua e em creaturescripts pode ser que tenha tbm...

  • <?xml version="1.0" encoding="UTF-8"?> <mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes"> <config name="firstitems_config"><

Postado
  • Solução
local config = {
                [1] = {
                                --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
                                items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
                                --container rope, shovel, mana potion
                                container = {{2120, 1}, {2554, 1}, {7620, 1}}
                },
                [2] = {
                                --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
                                items = {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2661, 1}},
                                --container rope, shovel, mana potion
                                container = {{2120, 1}, {2554, 1}, {7620, 1}}
                },
                [3] = {
                                --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
                                items = {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2661, 1}, {2480, 1}},
                                --container rope, shovel, health potion, bow, 50 arrow
                                container = {{2120, 1}, {2554, 1}, {7618, 1}, {2456, 1}, {2544, 50}}
                },
                [4] = {
                                --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
                                items = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
                                --container jagged sword, daramian mace, rope, shovel, health potion
                                container = {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 1}}
                }
}
 
function onLogin(cid)
        local player = Player(cid)
        local targetVocation = config[player:getVocation():getId()]
        if not targetVocation then
                return true
        end
 
        if player:getLastLoginSaved() ~= 0 then
                return true
        end
 
        for i = 1, #targetVocation.items do
                player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
        end
 
        local backpack = player:addItem(1988)
        if not backpack then
                return true
        end
 
        for i = 1, #targetVocation.container do
                backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
        end
		
		player:registerEvent("FirstItems")
		
        return true
end

Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado).

 

Tópicos:


 

yNlhRVC.png

 

55px-Judo_yellow_belt.svg.png

Postado
  • Autor

Perfeito, cara vocês são simplismente demais :D

 

só tem mais um erro que não tem nada haver com esse, quando inicio o otserver ele aparece isso.

 

[Error - DatabaseManager::updateDatabase - Version: -1] cannot open data/migrations/-1.lua: No such file or directory

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo