Ir para conteúdo
  • 0

First Itens


Marco Oliveira

Pergunta

Meu servidor tem o first itens porem ele não é por vocação.... alguém poderia me ajudar com isso haha ?

Lembrando que o servidor é 10.90 tfs 1.2

 

Script atual:

local firstItems = {2050, 2382}

function onLogin(player)
	if player:getLastLoginSaved() == 0 then
		for i = 1, #firstItems do
			player:addItem(firstItems[i], 1)
		end
		player:addItem(player:getSex() == 0 and 2651 or 2650, 1)
		player:addItem(1987, 1):addItem(2674, 1)
	end
	return true
end
Link para o comentário
Compartilhar em outros sites

9 respostass a esta questão

Posts Recomendados

  • 0


local config = {

[1] = {

--equipment

{{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}},

--container

{{2120, 1}, {2554, 1}, {7620, 1}}

},

[2] = {

--equipment

{{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}},

--container

{{2120, 1}, {2554, 1}, {7620, 1}}

},

[3] = {

--equipment

{{2389, 5}, {2660, 1}, {8923, 1}, {2456, 1}, {2544, 50}},

--container

{{2120, 1}, {2554, 1}, {7618, 1}}

},

[4] = {

--equipment

{{2509, 1}, {2465, 1}, {2481, 1}, {2478, 1}},

--container

{{8601, 1}, {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

for i = 1, #targetVocation[1] do

player:addItem(targetVocation[1][1], targetVocation[1][2])

end

 

local backpack = player:addItem(1988)

for i = 1, #targetVocation[2] do

backpack:addItem(targetVocation[2][1], targetVocation[2][2])

end

end

return true

end

 

Link para o comentário
Compartilhar em outros sites

  • 0
local config = {
    [1] = {
        --equipment
        {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}},
        --container
        {{2120, 1}, {2554, 1}, {7620, 1}}
    },
    [2] = {
        --equipment
        {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}},
        --container
        {{2120, 1}, {2554, 1}, {7620, 1}}
    },
    [3] = {
        --equipment     
        {{2389, 5}, {2660, 1}, {8923, 1}, {2456, 1}, {2544, 50}},
        --container
        {{2120, 1}, {2554, 1}, {7618, 1}}
    },
    [4] = {
        --equipment
        {{2509, 1}, {2465, 1}, {2481, 1}, {2478, 1}},
        --container
        {{8601, 1}, {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
        for i = 1, #targetVocation[1] do
            player:addItem(targetVocation[1][i][1], targetVocation[1][i][2])
        end
     
        local backpack = player:addItem(1988)
        for i = 1, #targetVocation[2] do
            backpack:addItem(targetVocation[2][i][1], targetVocation[2][i][2])
        end
    end
    return true
end

 

Poderia ne explicar a ordem ?

Link para o comentário
Compartilhar em outros sites

  • 0

[3] = {
--equipment
{{2389, 5}, {2660, 1}, {8923, 1}, {2456, 1}, {2544, 50}},
--container
{{2120, 1}, {2554, 1}, {7618, 1}}


[iD DA VOCAÇÃO]

-- equipamentos
{{itemid, quantidade}}
--- container [VEM DENTRO DA BP]
{{itemid, quantidade}}

Link para o comentário
Compartilhar em outros sites

  • 0

Deu este erro...

[Warning - Event::checkScript] Can not load script: scripts/firstitems.lua
data/creaturescripts/scripts/firstitems.lua:8: '}' expected (to close '{' at line 3) near '{'

Meu Script:

local config = {
    [1] = {
        {
		{2190, 1}, -- Wand of Vortex
		{2463, 1}, -- Plate Armor
		{2647, 1}, -- Plate Legs
		{8820, 1}  -- Stell Helmet
		{2525, 1}, -- Dwarven Shield
		},
        --container
        {{2120, 1},  -- Rope
		{2554, 1},  -- Shovel
    },
    [2] = {
        {
		{2182, 1}, -- Snakebite Rod
		{2463, 1}, -- Plate Armor
		{2647, 1}, -- Plate Legs
		{8820, 1}  -- Stell Helmet
		{2525, 1}, -- Dwarven Shield
		},
        --container
        {{2120, 1},  -- Rope
		{2554, 1},  -- Shovel
    },
    [3] = {
		{2389, 1}, -- Spear
		{2463, 1}, -- Plate Armor
		{2647, 1}, -- Plate Legs
		{8820, 1}  -- Stell Helmet
		{2525, 1}, -- Dwarven Shield
		},
        --container
        {{2120, 1},  -- Rope
		{2554, 1},  -- Shovel
    },
    [4] = {
		{2383, 1}, -- Spike Sword
		{2463, 1}, -- Plate Armor
		{2647, 1}, -- Plate Legs
		{8820, 1}  -- Stell Helmet
		{2525, 1}, -- Dwarven Shield
	    --container
        {{2120, 1},  -- Rope
		{2554, 1},  -- Shovel
		{2435, 1},  -- Dwarven Axe	
    }
}

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
        for i = 1, #targetVocation[1] do
            player:addItem(targetVocation[1][i][1], targetVocation[1][i][2])
        end
     
        local backpack = player:addItem(1988)
        for i = 1, #targetVocation[2] do
            backpack:addItem(targetVocation[2][i][1], targetVocation[2][i][2])
        end
    end
    return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

vc não colocou na forma que a gente falou...

 

local config = {
    [1] = {
			{
				{2190, 1}, -- Wand of Vortex
				{2463, 1}, -- Plate Armor
				{2647, 1}, -- Plate Legs
				{8820, 1}  -- Stell Helmet
				{2525, 1}, -- Dwarven Shield
			},
					--container
			{
				{2120, 1},  -- Rope
				{2554, 1},  -- Shovel
			}
		},	
    [2] = {
			{
				{2182, 1}, -- Snakebite Rod
				{2463, 1}, -- Plate Armor
				{2647, 1}, -- Plate Legs
				{8820, 1}  -- Stell Helmet
				{2525, 1}, -- Dwarven Shield
			},
        --container
			{
				{2120, 1},  -- Rope
				{2554, 1},  -- Shovel
			}
		},
    [3] = {
			{
				{2389, 1}, -- Spear
				{2463, 1}, -- Plate Armor
				{2647, 1}, -- Plate Legs
				{8820, 1}  -- Stell Helmet
				{2525, 1}, -- Dwarven Shield
			},
			--container
			{{2120, 1},  -- Rope
			{2554, 1},  -- Shovel
			}
		},		
    [4] = {
		{2383, 1}, -- Spike Sword
		{2463, 1}, -- Plate Armor
		{2647, 1}, -- Plate Legs
		{8820, 1}  -- Stell Helmet
		{2525, 1}, -- Dwarven Shield
	    --container
        {{2120, 1},  -- Rope
		{2554, 1},  -- Shovel
		{2435, 1},  -- Dwarven Axe			
		}
	},
}


 

 

Link para o comentário
Compartilhar em outros sites

  • 0

vc não colocou na forma que a gente falou...

 

 

 

local config = {
    [1] = {
			{
				{2190, 1}, -- Wand of Vortex
				{2463, 1}, -- Plate Armor
				{2647, 1}, -- Plate Legs
				{8820, 1}  -- Stell Helmet
				{2525, 1}, -- Dwarven Shield
			},
					--container
			{
				{2120, 1},  -- Rope
				{2554, 1},  -- Shovel
			}
		},	
    [2] = {
			{
				{2182, 1}, -- Snakebite Rod
				{2463, 1}, -- Plate Armor
				{2647, 1}, -- Plate Legs
				{8820, 1}  -- Stell Helmet
				{2525, 1}, -- Dwarven Shield
			},
        --container
			{
				{2120, 1},  -- Rope
				{2554, 1},  -- Shovel
			}
		},
    [3] = {
			{
				{2389, 1}, -- Spear
				{2463, 1}, -- Plate Armor
				{2647, 1}, -- Plate Legs
				{8820, 1}  -- Stell Helmet
				{2525, 1}, -- Dwarven Shield
			},
			--container
			{{2120, 1},  -- Rope
			{2554, 1},  -- Shovel
			}
		},		
    [4] = {
		{2383, 1}, -- Spike Sword
		{2463, 1}, -- Plate Armor
		{2647, 1}, -- Plate Legs
		{8820, 1}  -- Stell Helmet
		{2525, 1}, -- Dwarven Shield
	    --container
        {{2120, 1},  -- Rope
		{2554, 1},  -- Shovel
		{2435, 1},  -- Dwarven Axe			
		}
	},
}


 

 

 

 

Ainda não............

[Warning - Event::checkScript] Can not load script: scripts/firstitems.lua
data/creaturescripts/scripts/firstitems.lua:8: '}' expected (to close '{' at line 3) near '{'
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...