• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua need help with Firstitems

xx Kami xx

Retired.
Joined
Dec 29, 2012
Messages
509
Reaction score
20
hello can someone fix this script for me?

LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Firstitems" version="2.0" author="otland" contact="otland.com" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		commonItems = {
			{itemid=6103, count=1, useMessage=true},
			{itemid=2789, count=100, inContainer = true}, -- 100 brown mushrooms
			{itemid=2268, count=1, inContainer = true},
			{itemid=2293, count=1, inContainer = true},
			{itemid=2301, count=1, inContainer = true},
			{itemid=2261, count=1, inContainer = true}
			{itemid=1967, count=1, inContainer = true}
			{itemid=8976, count=1, inContainer = true}
		}
		firstItems = {
			{ -- Sorcerer	
				{itemid=1988}, -- backpack
				{itemid=3975}, -- spellbook
				{itemid=7426}, -- wand of vortex
				{itemid=2505}, -- magician's robe
				{itemid=7461}, -- mage hat
				{itemid=2507}, --  legs
				{itemid=2358}, -- boots
				{itemid=2173}, -- aol
				{itemid=2300, count=1, inContainer=true} -- mana potion
			},
			{ -- Druid
				{itemid=1988}, -- backpack
				{itemid=3975}, -- spellbook
				{itemid=7958}, -- wand of vortex
				{itemid=2505}, -- magician's robe
				{itemid=7461}, -- mage hat
				{itemid=2507}, -- studded legs
				{itemid=2358}, -- boots
				{itemid=2173}, -- aol
				{itemid=2300, count=1, inContainer=true} -- mana potion
			},
			{ -- Paladin
				{itemid=1988}, -- backpack
				{itemid=7438, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- 7438
				{itemid=2352, count=1, useSlot=true, slotType=CONST_SLOT_LAST}, -- 1 arrow
				{itemid=2505}, -- ranger's cloak
				{itemid=7461}, -- soldier helmet
				{itemid=2507}, -- ranger legs
				{itemid=2358}, -- boots
				{itemid=2173}, -- aol
				{itemid=2296, count=1, inContainer=true} 
			},
			{ -- Knight
				{itemid=1988}, -- backpack
				{itemid=3975}, -- steel shield
				{itemid=7416}, -- jagged sword
				{itemid=7435, inContainer=true}, -- steel axe
				{itemid=2505}, -- brass armor
				{itemid=7461}, -- soldier helmet
				{itemid=2507}, -- brass legs
				{itemid=2358}, -- boots
				{itemid=2173}, -- aol
				{itemid=2296, count=1, inContainer=true} -- health potion
			}
		}
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')
 
		for _, items in ipairs(firstItems) do
			for _, item in ipairs(commonItems) do
				table.insert(items, item)
			end
		end
 
		function onLogin(cid)
			if(getPlayerAccess(cid) < 3 and (getPlayerLastLoginSaved(cid) < 1) and firstItems[getPlayerVocation(cid)]) then
				for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
					if isItemContainer(v.itemid) then
						backpack = doPlayerAddItem(cid, v.itemid, 1, false)
					elseif v.inContainer then
						doAddContainerItem(backpack, v.itemid, v.count or 1)
					elseif v.useSlot then
						doPlayerAddItem(cid, v.itemid, v.count, false, v.slotType)
					elseif v.useMessage then
						local t, k = {
							writer = "Server Staff", date = os.time(),
							text = "Welcome " .. getCreatureName(cid) .. ".\n\nOur community would like to welcome you to " .. getConfigValue('serverName') .. ". If you need help with anything, please refer to the help channel.\n\nEnjoy your time!"
						}, doPlayerAddItem(cid, v.itemid, v.count or 1, false)
						doSetItemText(k, t.text, t.writer, t.date)
					else
						doPlayerAddItem(cid, v.itemid, v.count or 1)
					end
				end
			end
 
			return true
		end
	]]></event>
</mod>

Edit; This is the error i get
CAgbCln.png


Will Rep+++ if anyone can fix!! it wont work for me
 
this is my first items script!
PHP:
function onLogin(cid)
    if getPlayerStorageValue(cid, 30001) == -1 then
        if getPlayerVocation(cid) == 1 then
            doPlayerAddItem(cid, 2190, 1)--Wand Of Vortex
            doPlayerAddItem(cid, 2525, 1)--Copper Shield
            doPlayerAddItem(cid, 2457, 1)--Legion Helmet
            doPlayerAddItem(cid, 2463, 1)--Chain Armor
            doPlayerAddItem(cid, 2647, 1)--Chain Legs
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss
            doPlayerAddItem(cid, 2195, 1)--Leather Boots
            doPlayerAddItem(cid, 10518, 1)--Golden Backpack
            doPlayerAddItem(cid, 2674, 50)--Ham
            doPlayerAddItem(cid, 2124, 1)
            doPlayerAddItem(cid, 2268, 1)
            doPlayerAddItem(cid, 2276, 1)
            doPlayerAddItem(cid, 2273, 1)
            doPlayerAddItem(cid, 2160, 10)
            doPlayerAddItem(cid, 2554, 1)
            doPlayerAddItem(cid, 2120, 1)
            doPlayerAddItem(cid, 2127, 1)
            doPlayerAddItem(cid, 5810, 1)
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".")
        end
        if getPlayerVocation(cid) == 2 then
            doPlayerAddItem(cid, 2525, 1)--Copper Shield
            doPlayerAddItem(cid, 2182, 1)--Snakekbite Rod
            doPlayerAddItem(cid, 2457, 1)--Legion Helmet
            doPlayerAddItem(cid, 2463, 1)--Chain Armor
            doPlayerAddItem(cid, 2647, 1)--Chain Legs
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss
            doPlayerAddItem(cid, 2195, 1)--Leather Boots
            doPlayerAddItem(cid, 10518, 1)--Golden Backpack
            doPlayerAddItem(cid, 2674, 50)--Ham
            doPlayerAddItem(cid, 2124, 1)
            doPlayerAddItem(cid, 2268, 1)
            doPlayerAddItem(cid, 2276, 1)
            doPlayerAddItem(cid, 2273, 1)
            doPlayerAddItem(cid, 2127, 1)
            doPlayerAddItem(cid, 2160, 10)
            doPlayerAddItem(cid, 2554, 1)
            doPlayerAddItem(cid, 2120, 1)
            doPlayerAddItem(cid, 5810, 1)
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".")
        end
        if getPlayerVocation(cid) == 3 then
            doPlayerAddItem(cid, 2525, 1)--Copper Shield
            doPlayerAddItem(cid, 2456, 1)--Bow
            doPlayerAddItem(cid, 2457, 1)--Legion Helmet
            doPlayerAddItem(cid, 2463, 1)--Chain Armor
            doPlayerAddItem(cid, 2647, 1)--Chain Legs
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss
            doPlayerAddItem(cid, 2195, 1)--boots of haste
            doPlayerAddItem(cid, 10518, 1)--Golden Backpack
            doPlayerAddItem(cid, 2674, 50)--Ham
            doPlayerAddItem(cid, 2389, 1)--Spear
            doPlayerAddItem(cid, 2544, 1)
            doPlayerAddItem(cid, 2124, 1)
            doPlayerAddItem(cid, 2268, 1) 
            doPlayerAddItem(cid, 2276, 1)
            doPlayerAddItem(cid, 2127, 1)
            doPlayerAddItem(cid, 2273, 1)
            doPlayerAddItem(cid, 2160, 10)
            doPlayerAddItem(cid, 2554, 1)
            doPlayerAddItem(cid, 2120, 1)
            doPlayerAddItem(cid, 5810, 1)
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".")
        end
        if getPlayerVocation(cid) == 4 then
            doPlayerAddItem(cid, 2457, 1)--Legion Helmet
            doPlayerAddItem(cid, 2463, 1)--Chain Armor
            doPlayerAddItem(cid, 2525, 1)--Copper Shield
            doPlayerAddItem(cid, 2647, 1)--Chain Legs
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss
            doPlayerAddItem(cid, 2195, 1)--boots of haste
            doPlayerAddItem(cid, 10518, 1)--demon Backpack
            doPlayerAddItem(cid, 2383, 1)--Spike Sword
            doPlayerAddItem(cid, 2394, 1)--Morning Star
            doPlayerAddItem(cid, 2428, 1)--Orcish Axe
            doPlayerAddItem(cid, 2674, 50)--manzanas
            doPlayerAddItem(cid, 2124, 1)
            doPlayerAddItem(cid, 2313, 1)
            doPlayerAddItem(cid, 2276, 1)
            doPlayerAddItem(cid, 2273, 1)
            doPlayerAddItem(cid, 2127, 1)
            doPlayerAddItem(cid, 2160, 10)
            doPlayerAddItem(cid, 2554, 1)
            doPlayerAddItem(cid, 2120, 1)
            doPlayerAddItem(cid, 5810, 1)
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".")
        end
            setPlayerStorageValue(cid, 30001, 1)
    end
     return TRUE
end
 
this is my first items script!
PHP:
function onLogin(cid)
    if getPlayerStorageValue(cid, 30001) == -1 then
        if getPlayerVocation(cid) == 1 then
            doPlayerAddItem(cid, 2190, 1)--Wand Of Vortex
            doPlayerAddItem(cid, 2525, 1)--Copper Shield
            doPlayerAddItem(cid, 2457, 1)--Legion Helmet
            doPlayerAddItem(cid, 2463, 1)--Chain Armor
            doPlayerAddItem(cid, 2647, 1)--Chain Legs
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss
            doPlayerAddItem(cid, 2195, 1)--Leather Boots
            doPlayerAddItem(cid, 10518, 1)--Golden Backpack
            doPlayerAddItem(cid, 2674, 50)--Ham
            doPlayerAddItem(cid, 2124, 1)
            doPlayerAddItem(cid, 2268, 1)
            doPlayerAddItem(cid, 2276, 1)
            doPlayerAddItem(cid, 2273, 1)
            doPlayerAddItem(cid, 2160, 10)
            doPlayerAddItem(cid, 2554, 1)
            doPlayerAddItem(cid, 2120, 1)
            doPlayerAddItem(cid, 2127, 1)
            doPlayerAddItem(cid, 5810, 1)
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".")
        end
        if getPlayerVocation(cid) == 2 then
            doPlayerAddItem(cid, 2525, 1)--Copper Shield
            doPlayerAddItem(cid, 2182, 1)--Snakekbite Rod
            doPlayerAddItem(cid, 2457, 1)--Legion Helmet
            doPlayerAddItem(cid, 2463, 1)--Chain Armor
            doPlayerAddItem(cid, 2647, 1)--Chain Legs
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss
            doPlayerAddItem(cid, 2195, 1)--Leather Boots
            doPlayerAddItem(cid, 10518, 1)--Golden Backpack
            doPlayerAddItem(cid, 2674, 50)--Ham
            doPlayerAddItem(cid, 2124, 1)
            doPlayerAddItem(cid, 2268, 1)
            doPlayerAddItem(cid, 2276, 1)
            doPlayerAddItem(cid, 2273, 1)
            doPlayerAddItem(cid, 2127, 1)
            doPlayerAddItem(cid, 2160, 10)
            doPlayerAddItem(cid, 2554, 1)
            doPlayerAddItem(cid, 2120, 1)
            doPlayerAddItem(cid, 5810, 1)
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".")
        end
        if getPlayerVocation(cid) == 3 then
            doPlayerAddItem(cid, 2525, 1)--Copper Shield
            doPlayerAddItem(cid, 2456, 1)--Bow
            doPlayerAddItem(cid, 2457, 1)--Legion Helmet
            doPlayerAddItem(cid, 2463, 1)--Chain Armor
            doPlayerAddItem(cid, 2647, 1)--Chain Legs
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss
            doPlayerAddItem(cid, 2195, 1)--boots of haste
            doPlayerAddItem(cid, 10518, 1)--Golden Backpack
            doPlayerAddItem(cid, 2674, 50)--Ham
            doPlayerAddItem(cid, 2389, 1)--Spear
            doPlayerAddItem(cid, 2544, 1)
            doPlayerAddItem(cid, 2124, 1)
            doPlayerAddItem(cid, 2268, 1) 
            doPlayerAddItem(cid, 2276, 1)
            doPlayerAddItem(cid, 2127, 1)
            doPlayerAddItem(cid, 2273, 1)
            doPlayerAddItem(cid, 2160, 10)
            doPlayerAddItem(cid, 2554, 1)
            doPlayerAddItem(cid, 2120, 1)
            doPlayerAddItem(cid, 5810, 1)
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".")
        end
        if getPlayerVocation(cid) == 4 then
            doPlayerAddItem(cid, 2457, 1)--Legion Helmet
            doPlayerAddItem(cid, 2463, 1)--Chain Armor
            doPlayerAddItem(cid, 2525, 1)--Copper Shield
            doPlayerAddItem(cid, 2647, 1)--Chain Legs
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss
            doPlayerAddItem(cid, 2195, 1)--boots of haste
            doPlayerAddItem(cid, 10518, 1)--demon Backpack
            doPlayerAddItem(cid, 2383, 1)--Spike Sword
            doPlayerAddItem(cid, 2394, 1)--Morning Star
            doPlayerAddItem(cid, 2428, 1)--Orcish Axe
            doPlayerAddItem(cid, 2674, 50)--manzanas
            doPlayerAddItem(cid, 2124, 1)
            doPlayerAddItem(cid, 2313, 1)
            doPlayerAddItem(cid, 2276, 1)
            doPlayerAddItem(cid, 2273, 1)
            doPlayerAddItem(cid, 2127, 1)
            doPlayerAddItem(cid, 2160, 10)
            doPlayerAddItem(cid, 2554, 1)
            doPlayerAddItem(cid, 2120, 1)
            doPlayerAddItem(cid, 5810, 1)
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".")
        end
            setPlayerStorageValue(cid, 30001, 1)
    end
     return TRUE
end

this wont help me...the items i added i added myself...if i use yours ill have to add mine in all over again ;/
 
Try:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Firstitems" version="2.0" author="otland" contact="otland.com" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		commonItems = {
			{itemid=6103, count=1, useMessage=true},
			{itemid=2789, count=100, inContainer = true}, -- 100 brown mushrooms
			{itemid=2268, count=1, inContainer = true},
			{itemid=2293, count=1, inContainer = true},
			{itemid=2301, count=1, inContainer = true},
			{itemid=2261, count=1, inContainer = true},
			{itemid=1967, count=1, inContainer = true},
			{itemid=8976, count=1, inContainer = true}
		}
		firstItems = {
			{ -- Sorcerer	
				{itemid=1988}, -- backpack
				{itemid=3975}, -- spellbook
				{itemid=7426}, -- wand of vortex
				{itemid=2505}, -- magician's robe
				{itemid=7461}, -- mage hat
				{itemid=2507}, --  legs
				{itemid=2358}, -- boots
				{itemid=2173}, -- aol
				{itemid=2300, count=1, inContainer=true} -- mana potion
			},
			{ -- Druid
				{itemid=1988}, -- backpack
				{itemid=3975}, -- spellbook
				{itemid=7958}, -- wand of vortex
				{itemid=2505}, -- magician's robe
				{itemid=7461}, -- mage hat
				{itemid=2507}, -- studded legs
				{itemid=2358}, -- boots
				{itemid=2173}, -- aol
				{itemid=2300, count=1, inContainer=true} -- mana potion
			},
			{ -- Paladin
				{itemid=1988}, -- backpack
				{itemid=7438, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- 7438
				{itemid=2352, count=1, useSlot=true, slotType=CONST_SLOT_LAST}, -- 1 arrow
				{itemid=2505}, -- ranger's cloak
				{itemid=7461}, -- soldier helmet
				{itemid=2507}, -- ranger legs
				{itemid=2358}, -- boots
				{itemid=2173}, -- aol
				{itemid=2296, count=1, inContainer=true} 
			},
			{ -- Knight
				{itemid=1988}, -- backpack
				{itemid=3975}, -- steel shield
				{itemid=7416}, -- jagged sword
				{itemid=7435, inContainer=true}, -- steel axe
				{itemid=2505}, -- brass armor
				{itemid=7461}, -- soldier helmet
				{itemid=2507}, -- brass legs
				{itemid=2358}, -- boots
				{itemid=2173}, -- aol
				{itemid=2296, count=1, inContainer=true} -- health potion
			}
		}
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')
 
		for _, items in ipairs(firstItems) do
			for _, item in ipairs(commonItems) do
				table.insert(items, item)
			end
		end
 
		function onLogin(cid)
			if(getPlayerAccess(cid) < 3 and (getPlayerLastLoginSaved(cid) < 1) and firstItems[getPlayerVocation(cid)]) then
				for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
					if isItemContainer(v.itemid) then
						backpack = doPlayerAddItem(cid, v.itemid, 1, false)
					elseif v.inContainer then
						doAddContainerItem(backpack, v.itemid, v.count or 1)
					elseif v.useSlot then
						doPlayerAddItem(cid, v.itemid, v.count, false, v.slotType)
					elseif v.useMessage then
						local t, k = {
							writer = "Server Staff", date = os.time(),
							text = "Welcome " .. getCreatureName(cid) .. ".\n\nOur community would like to welcome you to " .. getConfigValue('serverName') .. ". If you need help with anything, please refer to the help channel.\n\nEnjoy your time!"
						}, doPlayerAddItem(cid, v.itemid, v.count or 1, false)
						doSetItemText(k, t.text, t.writer, t.date)
					else
						doPlayerAddItem(cid, v.itemid, v.count or 1)
					end
				end
			end
 
			return true
		end
	]]></event>
</mod>
 
You forgot to add some commas. Replace the "common" items with this:

LUA:
commonItems = {
			{itemid=6103, count=1, useMessage=true},
			{itemid=2789, count=100, inContainer = true}, -- 100 brown mushrooms
			{itemid=2268, count=1, inContainer = true},
			{itemid=2293, count=1, inContainer = true},
			{itemid=2301, count=1, inContainer = true},
			{itemid=2261, count=1, inContainer = true},
			{itemid=1967, count=1, inContainer = true},
			{itemid=8976, count=1, inContainer = true}
		}
 
LUA:
function onLogin(cid) 
    if getPlayerStorageValue(cid, 30001) == -1 then 
        if getPlayerVocation(cid) == 1 then 
            doPlayerAddItem(cid, 7426, 1)--Wand Of Vortex 
            doPlayerAddItem(cid, 1988, 1)--backpack
            doPlayerAddItem(cid, 3975, 1)--spellbook
            doPlayerAddItem(cid, 2505, 1)--magician robe
            doPlayerAddItem(cid, 7461, 1)--mage hat
            doPlayerAddItem(cid, 2173, 1)--Amulet of loss 
            doPlayerAddItem(cid, 2358, 1)--Boots
            doPlayerAddItem(cid, 2507, 1)--legs
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".") 
        end 
        if getPlayerVocation(cid) == 2 then 
            doPlayerAddItem(cid, 1988, 1)--backpack
            doPlayerAddItem(cid, 3975, 1)--steel shield
            doPlayerAddItem(cid, 7416, 1)--jagged sword
            doPlayerAddItem(cid, 7435, 1)--steel axe
            doPlayerAddItem(cid, 2505, 1)--brass armor
            doPlayerAddItem(cid, 7461, 1)--soldier helmet 
            doPlayerAddItem(cid, 2195, 1)--Leather Boots 
            doPlayerAddItem(cid, 2507, 1)--brass legs
            doPlayerAddItem(cid, 2296, 1)--aol
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".") 
        end 
        if getPlayerVocation(cid) == 3 then 
            doPlayerAddItem(cid, 2505, 1)--ranger's cloak
            doPlayerAddItem(cid, 7461, 1)--soldier helmet
            doPlayerAddItem(cid, 2507, 1)--ranger legs 
            doPlayerAddItem(cid, 2358, 1)--boots 
            doPlayerAddItem(cid, 2173, 1)-- aol 
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".") 
        end 
        if getPlayerVocation(cid) == 4 then 
            doPlayerAddItem(cid, 1988, 1)--backpack 
            doPlayerAddItem(cid, 3975, 1)--spellbook
            doPlayerAddItem(cid, 7958, 1)--wand of vortex 
            doPlayerAddItem(cid, 2505, 1)--magician robe 
            doPlayerAddItem(cid, 7461, 1)--mage hat
            doPlayerAddItem(cid, 2507, 1)--studded legs
            doPlayerAddItem(cid, 2358, 1)--boots 
            doPlayerAddItem(cid, 2173, 1)--aol 
            doPlayerAddItem(cid, 2300, 1)--mana potion
            doPlayerAddItem(cid, 2428, 1)--Orcish Axe 
            doPlayerAddItem(cid, 2674, 50)--manzanas 
        doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." ahora tienes los primeros items de "..getPlayerVocationName(cid)..".") 
        end 
            setPlayerStorageValue(cid, 30001, 1) 
    end 
     return TRUE 
end
 
Got the error that only Necromancers and Swordsman doesnt get any items at all, the other vocations is working .... Help please :)

Lua Code
local firstItems_storage = 30001

local commonItems = {
{itemid=2554, inContainer = TRUE}, -- shovel
{itemid=2120, inContainer = TRUE}, -- rope
{itemid=2160, count=2, inContainer = TRUE}, -- 2 crystal coins
{itemid=2643} -- leather boots
}
local firstItems = {
{ -- Sorcerer
{itemid=1988, container = TRUE}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2190}, -- wand of vortex
{itemid=8819}, -- magician's robe
{itemid=8820}, -- mage hat
{itemid=2468} -- studded legs
},
{ -- Druid
{itemid=1988, container = TRUE}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2509}, -- steel shield
{itemid=8819}, -- magician's robe
{itemid=8820}, -- mage hat
{itemid=2468} -- studded legs
},
{ -- Paladin
{itemid=1988, container = TRUE}, -- backpack
{itemid=2509}, -- steel shield
{itemid=2389, count = 10}, -- 10 spears
{itemid=2465}, -- brass armor
{itemid=2481}, -- soldier helmet
{itemid=2478} -- brass legs
},
{ -- Swordsman
{itemid=1988, container = TRUE}, -- backpack
{itemid=2509}, -- steel shield
{itemid=8602}, -- jagged sword
{itemid=2465}, -- brass armor
{itemid=2481}, -- soldier helmet
{itemid=2478} -- brass legs
},
{ -- Archer
{itemid=1988, container = TRUE}, -- backpack
{itemid=2456}, -- bow
{itemid=2544, count = 100}, -- 100 arrows
{itemid=2660}, -- ranger's cloak
{itemid=2480}, -- legion helmet
{itemid=8923} -- ranger legs
},
{ -- Legionaire
{itemid=1988, container = TRUE}, -- backpack
{itemid=8601, inContainer = TRUE}, -- steel axe
{itemid=2509}, -- steel shield
{itemid=2465}, -- brass armor
{itemid=2481}, -- soldier helmet
{itemid=2478} -- brass legs
},
{ -- Cleric
{itemid=1988, container = TRUE}, -- backpack
{itemid=2439, inContainer = TRUE}, -- daramanian mace
{itemid=2509}, -- steel shield
{itemid=2465}, -- brass armor
{itemid=2481}, -- soldier helmet
{itemid=2478} -- brass legs
},
{ -- Necromancer
{itemid=1988, container = TRUE}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2182}, -- snakebite rod
{itemid=8819}, -- magician's robe
{itemid=8820}, -- mage hat
{itemid=2468} -- studded legs
}

}

for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end

function onLogin(cid)
if getPlayerGroupId(cid) < 2 and getPlayerStorageValue(cid, firstItems_storage) <= 0 then
local currvoc = getPlayerVocation(cid)
local vocation = 8 > currvoc and currvoc or currvoc - 4
local giveItems = firstItems[vocation]
if giveItems then
for _, v in ipairs(giveItems) do
if v.container == TRUE then
backpack = doPlayerAddItem(cid, v.itemid, 1)
elseif v.inContainer == TRUE then
doAddContainerItem(backpack, v.itemid, v.count or 1)
else
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
end
end
setPlayerStorageValue(cid, firstItems_storage, 1)
end
return TRUE
end
 
Back
Top