• 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 The starting items

vTune

KakelmästareN^
Joined
Jun 14, 2012
Messages
3,675
Reaction score
395
Location
Sweden
Ok so I know there are alot of threads out there trying to explain how to solve and make you first items change. How ever non of them work for me.

So im trying to change the starter item in my server with no succes :(

Tried firstitems.xml doesnt work
Tried to give the samples items but when I relogg the items dissapear from the samples... :/

How do I solve this??

TFSV: 0.3.6 V5 Edtied by otswe.

If it makes any diffrence...

I will rep++ ofc if you can help me out :)

Kind Regards vTune
 
use this MOD..
data/mod create file .xml
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" 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=10, inContainer = true}, -- 10 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}
		}
		firstItems = {
			{ -- Sorcerer	
				{itemid=1988}, -- backpack
				{itemid=2520}, -- spellbook
				{itemid=2191}, -- wand of vortex
				{itemid=8871}, -- magician's robe
				{itemid=2323}, -- mage hat
				{itemid=7730}, -- studded legs
				{itemid=2195}, -- studded legs
				{itemid=2173}, -- studded legs
				{itemid=7590, count=1, inContainer=true} -- mana potion
			},
			{ -- Druid
				{itemid=1988}, -- backpack
				{itemid=2520}, -- spellbook
				{itemid=8911}, -- wand of vortex
				{itemid=8871}, -- magician's robe
				{itemid=2323}, -- mage hat
				{itemid=7730}, -- studded legs
				{itemid=2195}, -- studded legs
				{itemid=2173}, -- studded legs
				{itemid=7590, count=1, inContainer=true} -- mana potion
			},
			{ -- Paladin
				{itemid=1988}, -- backpack
				{itemid=8851, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- 8851
				{itemid=2547, count=100, useSlot=true, slotType=CONST_SLOT_LAST}, -- 100 arrow's
				{itemid=2498}, -- ranger's cloak
				{itemid=8891}, -- soldier helmet
				{itemid=7730}, -- ranger legs
				{itemid=2195}, -- ranger legs
				{itemid=2173}, -- studded legs
				{itemid=8472, count=1, inContainer=true}			},
			{ -- Knight
				{itemid=1988}, -- backpack
				{itemid=2520}, -- steel shield
				{itemid=2400}, -- jagged sword
				{itemid=7620, inContainer=true}, -- steel axe
				{itemid=2476}, -- brass armor
				{itemid=2477}, -- soldier helmet
				{itemid=2497}, -- brass legs
				{itemid=2195}, -- brass legs
				{itemid=2173}, -- studded legs
				{itemid=7591, 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>

And edit ID in file.xml , changed for itemid you need for vocations.
 
That will not work, because you have save disabled in samples characters, open your database and go to all samples configuration and enable save by replacing the 0 with a 1.

savee.png
 
Back
Top