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

Problems with start items...

LoveSong

New Member
Joined
Dec 16, 2007
Messages
185
Reaction score
0
Hello i have a big problem... My server is almost finished and ready to be lunched...


But everytime when i make a character, then he get all the start items 3x...

I dont understand why...

look thats my firstitem.lua:

local commonItems = {
-- ITEMS ALL VOCS RECEIVE
{itemid=2480, count=1}, -- legion helmet
{itemid=2464, count=1}, -- chain armor
{itemid=2648, count=1}, -- chain legs
{itemid=2643, count=1}, -- leather boots
{itemid=2120, count=1}, -- rope
{itemid=5710, count=1} -- shovel
}

local firstItems = {
{ -- SORC ITEMS
{itemid=2190, count=1}, -- wand of vortex
{itemid=2175, count=1} -- spellbook
},
{ -- DRUID ITEMS
{itemid=2182, count=1}, -- snakebite rod
{itemid=2175, count=1} -- spellbook
},
{ -- PALADIN ITEMS
{itemid=2389, count=1}, -- spear
{itemid=7378, count=1}, -- royal spear
{itemid=2530, count=1} -- copper shield
},
{ -- KNIGHT ITEMS
{itemid=2383, count=1}, -- spike sword
{itemid=2394, count=1}, -- morning star
{itemid=2428, count=1}, -- orcish axe
{itemid=2530, count=1} -- copper shield
}
}

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 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

if hasReceivedFirstItems ~= 1 then
--[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)

local giveItems = firstItems[getPlayerVocation(cid)]

if giveItems ~= nil then
for _, v in ipairs(giveItems) do
--doAddContainerItem(backpack, v.itemid, v.count or 1)
doPlayerAddItem(cid, v.itemid, v.count or 1)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The instance downstairs is reccommended for new players!")
end
setPlayerStorageValue(cid, 67708, 1)
end
end
return TRUE
end

Help please :P
 
When i put firstitems on knight sample and create a knight from my webside i dont get the items that i gave to the knight sample do i have to delete the firstitem thing on my server folder? xd
 
Test this:
local commonItems = {
-- ITEMS ALL VOCS RECEIVE
{itemid=2480, count=1}, -- legion helmet
{itemid=2464, count=1}, -- chain armor
{itemid=2648, count=1}, -- chain legs
{itemid=2643, count=1}, -- leather boots
{itemid=2120, count=1}, -- rope
{itemid=5710, count=1}, -- shovel
}

local firstItems = {
{ -- SORC ITEMS
{itemid=2190, count=1}, -- wand of vortex
{itemid=2175, count=1}, -- spellbook
},
{ -- DRUID ITEMS
{itemid=2182, count=1}, -- snakebite rod
{itemid=2175, count=1}, -- spellbook
},
{ -- PALADIN ITEMS
{itemid=2389, count=1}, -- spear
{itemid=7378, count=1}, -- royal spear
{itemid=2530, count=1}, -- copper shield
},
{ -- KNIGHT ITEMS
{itemid=2383, count=1}, -- spike sword
{itemid=2394, count=1}, -- morning star
{itemid=2428, count=1}, -- orcish axe
{itemid=2530, count=1}, -- copper shield
}
}

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 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)

if hasReceivedFirstItems ~= 1 then
--[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)

local giveItems = firstItems[getPlayerVocation(cid)]

if giveItems ~= nil then
for _, v in ipairs(giveItems) do
--doAddContainerItem(backpack, v.itemid, v.count or 1)
doPlayerAddItem(cid, v.itemid, v.count or 1)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved your first items!")
end
setPlayerStorageValue(cid, 67708, 1)
end
end
return TRUE
end

Creaturescript.xml
<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>

If i helped you rep my :P
 
Code:
local commonItems = {
	{2480, 1}, -- legion helmet
	{2464, 1}, -- chain armor
	{2648, 1}, -- chain legs
	{2643, 1}, -- leather boots
	{2120, 1}, -- rope
	{5710, 1} -- shovel
}
local firstItems = {
	[1] = { ---Sorcerer
		{2190, 1}, -- wand of vortex
		{2175, 1} -- spellbook
	},
	[2] = { ---Druid
		{2182, 1}, -- snakebite rod
		{2175, 1} -- spellbook
	},
	[3] = { ---Paladin
		{2389, 1}, -- spear
		{7378, 1}, -- royal spear
		{2530, 1} -- copper shield
	},
	[4] = { ---Knight
		{2383, 1}, -- spike sword
		{2394, 1}, -- morning star
		{2428, 1}, -- orcish axe
		{2530, 1} -- copper shield
	}
}
function onLogin(cid)
	registerCreatureEvent(cid, "FIRST")
	if getPlayerGroupId(cid) < 2 then
		if getPlayerStorageValue(cid, 67720) == -1 then
			for _, v in ipairs(commonItems) do
				doPlayerAddItem(cid, v[1], v[2])
			end
			if getPlayerItemCount(cid, 1987) >= 1 then
				doPlayerRemoveItem(cid, 1987, getPlayerItemCount(cid, 1987))
			end
			for _, t in ipairs(firstItems[getPlayerVocation(cid)]) do
				doAddContainerItem(doPlayerAddItem(cid, 1988, 1), t[1], t[2])
			end
			setPlayerStorageValue(cid, 67720, 1)
			doPlayerSendTextMessage(cid, 20, "The instance downstairs is reccommended for new players!")
		end
	end
	return true
end
 
Last edited:
This is the one im using. It's a MOD version.
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
			doPlayerAddLevel(cid, 7) -- Level 8
			local bag = doPlayerAddItem(cid, 1988, 1)
	
			doAddContainerItem(bag, 2120, 1) -- Rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			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
			doPlayerAddLevel(cid, 7) -- Level 8
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			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
			doPlayerAddLevel(cid, 7) -- Level 8
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			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
			doPlayerAddLevel(cid, 7) -- Level 8
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			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>
 
Back
Top