• 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!

Solved First items MOD error

Vendeliko

Banned User
Joined
Dec 3, 2011
Messages
3,087
Reaction score
93
Location
Beside that guy with that thing but without that t
Hey guys,I was recently trying to add first items mod to my server and before I changed & added some item ids it worked fine but now im getting some error and the server shutsdown,could any of you please help me solve it?


Error:
hum-1346542860.jpg


Script:
Code:
<?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"><![CDATA[
		config = {
			storage = 30005,
			items = {2050}
		}
	]]></config>
	<event type="login" name="FirstItems" event="script"> <![CDATA[
		domodlib('firstitems_config')
 
		function onLogin(cid)
	local config = {
		voc_items = {
			{ -- SORC
				{2186}, -- wand of vortex
				{8900}, -- spellbook
				{2323}, -- mage hat
	                {7730}, -- legs
	                {2268, 100}, -- sd
	                {2305, 15}, -- fb
	                {2261, 15}, -- df
	                {2293, 25}, -- mw
	                {7589, 100}, -- smp
	                {2275, 50}, -- ava
				{8870} -- mage robe

			},
			{ -- DRUID
				{2183}, -- snakebite rod
			     {8900}, -- spellbook
				{2323}, -- mage hat
	                {2268, 100}, -- sd
	                {2305, 15}, -- fb
	                {2261, 15}, -- df
	                {2269, 25}, -- wg
	                {7589, 100}, -- smp
	                {2275, 50}, -- ava
	                {7730}, -- legs
				{8870} -- mage robe

			},
			{ -- PALADIN
				{7367}, -- throwing knife
				{2528}, -- copper shield
				{2475}, -- legion helmet
				{8872}, -- chain armor
	                {2305, 15}, -- fb
	                {2261, 15}, -- df
	                {2293, 25}, -- mw
	                {7589, 50}, -- smp
	                {7588, 50}, -- smp
	                {2275, 20}, -- ava
	                {2313, 50}, -- explo
	                {2498} -- studded legs
			},
			{ -- KNIGHT
	                {2305, 15}, -- fb
	                {2261, 15}, -- df
	                {7589, 50}, -- smp
	                {7588, 50}, -- smp
	                {2275, 20}, -- ava
	                {2313, 50}, -- explo
				{2407}, -- serpent sword
				{2516}, -- copper shield
				{2491}, -- legion helmet
				{2487} -- chain armor
	                {2488}, -- legs
			}
		},
		all_items = {
			{2002}, -- bp	           
                {2554}, -- shovel
	           {11303}, -- zaoan shoes
			{2120} -- rope
	{2789, 100}
		},
		extra_items = {
			{2789, 100}
		},
knight_weapons = {
	            {2432}, -- axe
	            {7430}, -- club
		
		}
	}

	if getPlayerGroupId(cid) < 3 then
		if getPlayerStorageValue(cid, storage) == -1 then
			local common = config.voc_items[getPlayerVocation(cid)]
			if common ~= nil then
				for _, v in ipairs(common) do
					doPlayerAddItem(cid, v[1], v[2] or 1)
				end
			end
 
			local all = config.all_items
			if all ~= nil then
				for _, v in ipairs(all) do
					doPlayerAddItem(cid, v[1], v[2] or 1)
				end
			end
 
			local extra = config.extra_items
			local bp = doPlayerAddItem(cid, 1988, 1)
			if extra ~= nil then
				for _, v in ipairs(extra) do
					doAddContainerItem(bp, v[1], v[2] or 1)
				end
			end
 
			local weapons = config.knight_weapons
			if weapons ~= nil then
				for _, w in ipairs(weapons) do
					if isKnight(cid) then
						doAddContainerItem(bp, w[1], w[2] or 1)
					end
				end
			end
 
			setPlayerStorageValue(cid, storage, 1)
		end
	end
	return true
end
	]]></event>
</mod>

Thanks in advance,
Vendeliko.
 
Last edited:
Try this;
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Kaiser" contact="[email protected]" enabled="yes">
	<description><![CDATA[
		Custom Fist Items
	]]></description>
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 40046,
			items = {}
		}
	]]></config>
	<event type="login" name="FirstItems" event="buffer"><![CDATA[
		domodlib('firstitems_config')
		if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end

		for _, id in ipairs(config.items) do
			doPlayerAddItem(cid, id, 1)
		end

		-- All Vocation
			-- BackPack -- Rope -- in Backpack
			doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2120, 1)
			-- Brass Armor -- Body
			doPlayerAddItem(cid, 2465, 1)
			-- Steel Helmet -- Head
			doPlayerAddItem(cid, 2457, 1)
			-- Bonelord Shield -- Right Hand
			doPlayerAddItem(cid, 2518, 1)

		-- Sorcerer (Weapon) -- Hand
		if isSorcerer(cid) then
			doPlayerAddItem(cid, 2190, 1) -- Wand of Vortex -- Left Hand
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." now have the first items of "..getPlayerVocationName(cid)..".")

		-- Druid (Weapon) -- Hand
		elseif isDruid(cid) then
			doPlayerAddItem(cid, 2182, 1) -- Snake Bite Rod -- Left Hand
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." now have the first items of "..getPlayerVocationName(cid)..".")

		-- Paladin - Warrior (Weapon) -- Hand
		elseif isPaladin(cid) then
			doPlayerAddItem(cid, 2389, 20) -- Spear -- Left Hand
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." now have the first items of "..getPlayerVocationName(cid)..".")

		-- Knight (Weapon) -- Hand
		elseif isKnight(cid) then
			doPlayerAddItem(cid, 8602, 1) -- Jagged Sword -- Left Hand
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." now have the first items of "..getPlayerVocationName(cid)..".")
		end

		-- All Vocation
			-- Brass Legs -- in Feet
			doPlayerAddItem(cid, 2478, 1)
			-- Leather Boots -- in Boots
			doPlayerAddItem(cid, 2643, 1)
			-- Scarf -- in Necklacke
			doPlayerAddItem(cid, 2661, 1)
			-- Platinum Coin -- in Arrows
			doPlayerAddItem(cid, 2152, 1)
			-- Health Potion -- in Backpack
			doPlayerAddItem(cid, 7618, 10)
			-- Shovel -- in Backpack
			doPlayerAddItem(cid, 2554, 1)
			-- Crystal Ring -- in Ring
			doPlayerAddItem(cid, 2124, 1)
			-- Mana Potion -- in Backpack
			doPlayerAddItem(cid, 7620, 15)

		-- Knight (Weapon) -- in Backpack
		if isKnight(cid) then
			doPlayerAddItem(cid, 8601, 1) -- Steel Axe
			doPlayerAddItem(cid, 2439, 1) -- Daramanian mace
		end

	setPlayerStorageValue(cid, config.storage, 1)
	]]></event>
</mod>
 
Back
Top