• 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 firstitems mod very fast

The firstitems mod file is in the TFS folder by default. Just download a fresh TFS folder and take the mod file from there.
 
I had this on my computer.. You have to change it yourself
If you don't like it, don't use it :thumbup:

Lua:
<?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 = 30001,
			items = {2050, 2382}
		}
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')

		function onLogin(cid)
			if(getPlayerStorageValue(cid, config.storage) > 0) then
				return true
			end

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

			if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
				doPlayerAddItem(cid, 2651, 1)
			else
				doPlayerAddItem(cid, 2650, 1)
			end

			doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 1)
			setPlayerStorageValue(cid, config.storage, 1)
			return true
		end
	]]></event>
</mod>
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Apsivaflines" contact="antica.sytes.net" enabled="yes">
	<config name="firstitems_config"><![CDATA[
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')

		function onLogin(cid)
	if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
		if isSorcerer(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
	
			doAddContainerItem(bag, 2120, 1) -- Rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 7620, 1) -- Mana potion
			doAddContainerItem(bag, 7618, 1) -- Health potion
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coints
		
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2190, 1) -- wand of wortex
			doPlayerAddItem(cid, 8819, 1) -- magician's robe
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2468, 1) -- studded legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

		setPlayerStorageValue(cid, 50000, 1)

		elseif isDruid(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 7620, 1) -- Mana potion
			doAddContainerItem(bag, 7618, 1) -- Health potion
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
		
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2182, 1) -- snakebite rod
			doPlayerAddItem(cid, 8819, 1) -- magican's robe
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2468, 1) -- studded legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			setPlayerStorageValue(cid, 50000, 1)

		elseif isPaladin(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 7620, 1) -- Mana potion
			doAddContainerItem(bag, 7618, 1) -- Health potion
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
		
			doPlayerAddItem(cid, 2389, 1) -- spear
                        doPlayerAddItem(cid, 2456, 1) -- bow
			doPlayerAddItem(cid, 2544, 100) -- 100 arrows
			doPlayerAddItem(cid, 2660, 1) -- hidden turban
			doPlayerAddItem(cid, 2480, 1) -- legion helmet
			doPlayerAddItem(cid, 8923, 1) -- ranger legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			setPlayerStorageValue(cid, 50000, 1)

		elseif isKnight(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 7620, 1) -- Mana potion
			doAddContainerItem(bag, 7618, 1) -- Health potion
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
			doAddContainerItem(bag, 2439, 1) -- daramanian mace
			doAddContainerItem(bag, 8601, 1) -- steel axe
		
			doPlayerAddItem(cid, 2509, 1) -- steel shield
			doPlayerAddItem(cid, 8602, 1) -- jagged sword
			doPlayerAddItem(cid, 2465, 1) -- brass armor
			doPlayerAddItem(cid, 2481, 1) -- soldier helmet
			doPlayerAddItem(cid, 2478, 1) -- brass legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			setPlayerStorageValue(cid, 50000, 1)
		end
	end
 	return TRUE
end
	]]></event>
</mod>
Next time. say please or something. credit goes to original author .if it helped you, rep please.
basiclly, it gives you the items necessary for a specific vocation, making it way easier.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		STORAGE = 30001
		commonItems = {
			{itemid=2160, count=3, inContainer = true}, -- 2 platinum coins
			{itemid=2643} -- leather boots
		}
		firstItems = {
			{ -- Sorcerer	
				{itemid=1988}, -- backpack
				{itemid=2521}, -- dark shield
				{itemid=2190}, -- wand of vortex
				{itemid=8819}, -- magician's robe
				{itemid=8820}, -- mage hat
				{itemid=7730}  -- blue legs
			},
			{ -- Druid
				{itemid=1988}, -- backpack
				{itemid=2521}, -- dark shield
				{itemid=2182}, -- snakebite rod
				{itemid=8819}, -- magician's robe
				{itemid=8820}, -- mage hat
				{itemid=7730}  -- blue legs
			},
			{ -- Paladin
				{itemid=1988}, -- backpack
				{itemid=2521}, -- dark shield
				{itemid=2389, count=3}, -- 3 spears
				{itemid=2463}, -- plate armor
				{itemid=2457}, -- steel helmet
				{itemid=2647}  -- plate legs
			},
			{ -- Knight
				{itemid=1988}, -- backpack
				{itemid=2521}, -- dark shield
				{itemid=2394}, -- morning star
				{itemid=2463}, -- plate armor
				{itemid=2457}, -- steel helmet
				{itemid=2647}  -- plate legs
			}
		}
	]]></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 getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 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)
					elseif v.inContainer then
						doAddContainerItem(backpack, v.itemid, v.count or 1)
					else
						doPlayerAddItem(cid, v.itemid, v.count or 1)
					end
				end
				setPlayerStorageValue(cid, STORAGE, 1)
			end
			return true
		end
	]]></event>
</mod>
 
Back
Top