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

First Items Bugg.

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
Hello i have use diffrent first items script all works good but when first login all items get under the char? the chars have no eq but cab to take all..

script:
Lua:
local storage = 50000
function onLogin(cid)
	local config = {
		voc_items = {
			{ -- SORC
				{2190}, -- wand of vortex
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819} -- mage robe
			},
			{ -- DRUID
				{2182}, -- snakebite rod
				{2175}, -- spellbook
				{8820}, -- mage hat
				{8819} -- mage robe
			},
			{ -- PALADIN
				{2410}, -- throwing knife
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			},
			{ -- KNIGHT
				{2409}, -- serpent sword
				{2530}, -- copper shield
				{2480}, -- legion helmet
				{2464} -- chain armor
			}
		},
		all_items = {
			{2468}, -- studded legs
			{2643} -- leather boots
		},
		extra_items = {
			{2160, 2},
			{2789, 10},
			{7620},
			{7618}
		},
		knight_weapons = {
			{2423}, -- clerical mace
			{2429} -- barbarian axe
		}
	}
	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
 
Last edited by a moderator:
Use this mod,
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>
 
Don't use any mod, it goes messy sometimes, also TFS v6 isn't recommended yet, It has a lot of bugs because is not finished yet afaik, use TFS 0.3.6 V5, is more stable and full without bugs.
 
Are you using the sample chars? I Remember having the same problem, but i can remember how i solved it.

Anyways, go to your database and enable saves on your samples, then log them in 1 by 1 and put the EQ you want people to start with on each vocation, then go back to the database and change so they save again.

Look for save = 0 or something in database.
 
Back
Top