Hey J.dre i got a problem with firstitems.xml. I tried some different .xmls but the problem keeps occuring to me.
When i make a new character on my OT the items fall on the ground instead of the eq slots. First i thought, maybe the cap wasn't sufficient enough. But when i equip all the items i still got some cap left.
I hope you know where this problem lies!
Excuse my incompetence, but how I can do if I have one single class?
The Id Is 0 Is The No-Vocation (None)
firstItems = {
{ -- No Vocation
{itemid=1987}, -- bag
{itemid=xxxx}, -- shield
{itemid=xxxx}, -- weapon
{itemid=xxxx}, -- armor
{itemid=xxxx}, -- helmet
{itemid=xxxx}, -- legs
{itemid=xxxx, count=3, inContainer=true} -- small health potion
},
{ -- Sorcerer
{itemid=1988}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2190}, -- wand of vortex
{itemid=8819}, -- magician's robe
{itemid=8820}, -- mage hat
{itemid=2468}, -- studded legs
{itemid=7620, count=3, inContainer=true} -- mana potion
},
{ -- Druid
{itemid=1988}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2182}, -- snakebite rod
{itemid=8819}, -- magician's robe
{itemid=8820}, -- mage hat
{itemid=2468}, -- studded legs
{itemid=7620, count=3, inContainer=true} -- mana potion
},
{ -- Paladin
{itemid=1988}, -- backpack
{itemid=2456, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- bow
{itemid=2544, count=100, useSlot=true, slotType=CONST_SLOT_LAST}, -- 100 arrow's
{itemid=2660}, -- ranger's cloak
{itemid=2481}, -- soldier helmet
{itemid=8923}, -- ranger legs
{itemid=7618, count=1, inContainer=true}, -- health potion
{itemid=7620, count=2, inContainer=true} -- mana potion
},
{ -- Knight
{itemid=1988}, -- backpack
{itemid=2509}, -- steel shield
{itemid=8602}, -- jagged sword
{itemid=8601, inContainer=true}, -- steel axe
{itemid=2439, inContainer=true}, -- daramanian mace
{itemid=2465}, -- brass armor
{itemid=2481}, -- soldier helmet
{itemid=2478}, -- brass legs
{itemid=7618, count=3, inContainer=true} -- health potion
}
}
[1:42:04.358] Description:
[1:42:04.360] [string "LuaInterface::loadBuffer"]:3: bad argument #1 to 'ipairs'
(table expected, got nil)
[1:42:04.363] [Warning - Event::loadScript] Cannot load script (
domodlib('firstitems_config')
[1:42:04.366]
[1:42:04.369] for _, items in ipairs(firstItems) do
[1:42:04.371] for _, item in ipairs(commonItems) do
[1:42:04.374] table.insert(items, item)
[1:42:04.377] end
[1:42:04.379] end
[1:42:04.379]
[1:42:04.381] function onLogin(cid)
[1:42:04.383] if(getPlayerAccess(cid) < 3 and (getPlayerLastLo
ginSaved(cid) < 1) and firstItems[getPlayerVocation(cid)]) then
[1:42:04.385] for _, v in ipairs(firstItems[getPlayerV
ocation(cid)]) do
[1:42:04.387] if isItemContainer(v.itemid) the
n
[1:42:04.389] backpack = doPlayerAddIt
em(cid, v.itemid, 1, false)
[1:42:04.390] elseif v.inContainer then
[1:42:04.392] doAddContainerItem(backp
ack, v.itemid, v.count or 1)
[1:42:04.395] elseif v.useSlot then
[1:42:04.397] doPlayerAddItem(cid, v.i
temid, v.count, false, v.slotType)
[1:42:04.398] elseif v.useMessage then
[1:42:04.400] local t, k = {
[1:42:04.402] writer = "Hell",
date = os.time(),
[1:42:04.404] text = "Welcome
" .. getCreatureName(cid) .. ".\n\nWe hope you will have fun on " .. getConfigVa
lue('serverName') .. ". If you need help with anything, please refer to the help
channel.\n\nEnjoy your time!"
[1:42:04.407] }, doPlayerAddItem(cid,
v.itemid, v.count or 1, false)
[1:42:04.411] doSetItemText(k, t.text,
t.writer, t.date)
[1:42:04.413] else
[1:42:04.415] doPlayerAddItem(cid, v.i
temid, v.count or 1)
[1:42:04.418] end
[1:42:04.420] end
[1:42:04.421] end
[1:42:04.423]
[1:42:04.426] return true
[1:42:04.428] end
[1:42:04.430] )
[1:42:04.432] done.
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="2.0" author="J.Dre" contact="[email protected]" enabled="yes">
<config name="firstitems_config"><![CDATA[
commonItems = {
{itemid=2661, count=1, useSlot=true, slotType=CONST_SLOT_NECKLACE}, -- scarf
{itemid=2512, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- wooden shield
{itemid=2482, count=1, useSlot=true, slotType=CONST_SLOT_HEAD}, -- helmet
{itemid=7464, count=1, useSlot=true, slotType=CONST_SLOT_LEGS}, -- legs
{itemid=2642, count=1, useSlot=true, slotType=CONST_SLOT_FEET} -- boots
},
firstItems = {
{ -- Sorcerer
{itemid=1988}, -- backpack
{itemid=2654, count=1, useSlot=true, slotType=CONST_SLOT_ARMOR}, -- cape
{itemid=10301, count=1, useSlot=true, slotType=CONST_SLOT_RIGHT}, -- wand
{itemid=7620, count=25, inContainer=true}, -- mana potion
{itemid=2789, count=20, inContainer=true}, -- brown mushroom
{itemid=2160, count=1, inContainer=true} -- crystal coin
},
{ -- Druid
{itemid=1988}, -- backpack
{itemid=2654, count=1, useSlot=true, slotType=CONST_SLOT_ARMOR}, -- cape
{itemid=10301, count=1, useSlot=true, slotType=CONST_SLOT_RIGHT}, -- wand
{itemid=7620, count=100, inContainer=true}, -- mana potion
{itemid=2789, count=20, inContainer=true}, -- brown mushroom
{itemid=2160, count=1, inContainer=true} -- crystal coin
},
{ -- Paladin
{itemid=1988}, -- backpack
{itemid=5907, count=1, useSlot=true, slotType=CONST_SLOT_RIGHT}, -- slingshot
{itemid=1294, count=100, useSlot=true, slotType=CONST_SLOT_LAST}, -- 100 stones
{itemid=2651, count=1, useSlot=true, slotType=CONST_SLOT_ARMOR}, -- jacket
{itemid=7618, count=100, inContainer=true}, -- health potion
{itemid=7620, count=50, inContainer=true}, -- mana potion
{itemid=2789, count=20, inContainer=true}, -- brown mushroom
{itemid=2160, count=1, inContainer=true} -- crystal coin
},
{ -- Knight
{itemid=1988}, -- backpack
{itemid=2651, count=1, useSlot=true, slotType=CONST_SLOT_ARMOR}, -- jacket
{itemid=2450, count=1, useSlot=true, slotType=CONST_SLOT_RIGHT}, -- bone sword
{itemid=2429, count=20, inContainer=true}, -- barbarian axe
{itemid=2448, count=20, inContainer=true}, -- studded club
{itemid=2789, count=20, inContainer=true}, -- brown mushroom
{itemid=2160, count=1, inContainer=true}, -- crystal coin
{itemid=7618, count=100, 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 = "Hell", date = os.time(),
text = "Welcome " .. getCreatureName(cid) .. ".\n\nWe hope you will have fun on " .. 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>
Nice Mod! would like to use it but having an error that i don't understand.. Tfs 0.4- 8.7 any ideas?
Does the script in the first post work for you without editing it? It may be the version of TFS you're using.
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="2.0" author="J.Dre" contact="[email protected]" enabled="yes">
<config name="firstitems_config"><![CDATA[
commonItems = {
{itemid=6103, count=1, useMessage=true}, -- a book (or whatever) with a message
{itemid=2789, count=100, inContainer = true}, -- 100 brown mushrooms
{itemid=2160, count=1, inContainer = true}, -- 1 platinum coins
{itemid=2305, count=1, inContainer = true}, -- fire bomb rune
{itemid=2261, count=1, inContainer = true}, -- destroy field rune
{itemid=10515, count=1, inContainer = true}, -- navaja
{itemid=2661, count=100, inContainer = true}, -- scarf
{itemid=2195} -- boots of haste
}
}
firstItems = {
{ -- Sorcerer
{itemid=2002}, -- blue backpack
{itemid=8902}, -- spellbook of mind control
{itemid=2187}, -- wand of inferno
{itemid=8871}, -- focus cape
{itemid=2323}, -- hat of the mad
{itemid=7730}, -- blue legs
{itemid=7590, count=1, inContainer=true}, -- great mana potion
{itemid=2268, count=1, inContainer=true}, -- sd
{itemid=2273, count=1, inContainer=true}, -- uh
{itemid=2293, count=1, inContainer=true} -- mw
},
{ -- Druid
{itemid=2002}, -- blue backpack
{itemid=8902}, -- spellbook of mind control
{itemid=2183}, -- hailstorm rod
{itemid=8871}, -- focus cape
{itemid=2323}, -- hat of the mad
{itemid=7730}, -- blue legs
{itemid=7590, count=1, inContainer=true}, -- great mana potion
{itemid=2268, count=1, inContainer=true}, -- sd
{itemid=2273, count=1, inContainer=true}, -- uh
{itemid=2293, count=1, inContainer=true}, -- mw
{itemid=2269, count=1, inContainer=true}, -- wg
{itemid=2278, count=1, inContainer=true} -- para
},
{ -- Paladin
{itemid=2004}, -- golden backpack
{itemid=2514}, -- mastermind shield
{itemid=7368}, -- assassin stars
{itemid=8891}, -- paladin armor
{itemid=2493}, -- demon helmet
{itemid=7730}, -- blue legs
{itemid=2268, count=1, inContainer=true}, -- sd
{itemid=2273, count=1, inContainer=true}, -- uh
{itemid=7590, count=1, inContainer=true}, -- gsp gmp
{itemid=7590, count=1, inContainer=true}, -- smp gmp
{itemid=7590, count=1, inContainer=true}, -- shp gmp
{itemid=2293, count=1, inContainer=true} -- mw
},
{ -- Knight
{itemid=2003}, -- grey backpack
{itemid=2509}, -- steel shield
{itemid=2400}, -- magic sword
{itemid=2431, inContainer=true}, -- stonecutter axe
{itemid=8928, inContainer=true}, -- obsidian truncheon
{itemid=2472}, -- magic plate armor
{itemid=2493}, -- demon helmet
{itemid=2470}, -- golden legs
{itemid=7590, count=1, inContainer=true}, -- mp gmp
{itemid=7590, count=1, inContainer=true}, -- ghp gmp
{itemid=7590, count=1, inContainer=true}, -- uhp gmp
{itemid=2313, count=1, inContainer=true}, -- explosion
{itemid=2293, count=1, inContainer=true} -- mw
}
}
]]></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>
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="2.0" author="J.Dre" contact="[email protected]" enabled="yes">
<config name="firstitems_config"><![CDATA[
commonItems = {
{itemid=6103, count=1, useMessage=true}, -- a book (or whatever) with a message
{itemid=2789, count=100, inContainer = true}, -- 100 brown mushrooms
{itemid=2160, count=1, inContainer = true}, -- 1 platinum coins
{itemid=2305, count=1, inContainer = true}, -- fire bomb rune
{itemid=2261, count=1, inContainer = true}, -- destroy field rune
{itemid=10515, count=1, inContainer = true}, -- navaja
{itemid=2661, count=100, inContainer = true}, -- scarf
{itemid=2195} -- boots of haste
}
firstItems = {
{ -- Sorcerer
{itemid=2002}, -- blue backpack
{itemid=8902}, -- spellbook of mind control
{itemid=2187}, -- wand of inferno
{itemid=8871}, -- focus cape
{itemid=2323}, -- hat of the mad
{itemid=7730}, -- blue legs
{itemid=7590, count=1, inContainer=true}, -- great mana potion
{itemid=2268, count=1, inContainer=true}, -- sd
{itemid=2273, count=1, inContainer=true}, -- uh
{itemid=2293, count=1, inContainer=true} -- mw
},
{ -- Druid
{itemid=2002}, -- blue backpack
{itemid=8902}, -- spellbook of mind control
{itemid=2183}, -- hailstorm rod
{itemid=8871}, -- focus cape
{itemid=2323}, -- hat of the mad
{itemid=7730}, -- blue legs
{itemid=7590, count=1, inContainer=true}, -- great mana potion
{itemid=2268, count=1, inContainer=true}, -- sd
{itemid=2273, count=1, inContainer=true}, -- uh
{itemid=2293, count=1, inContainer=true}, -- mw
{itemid=2269, count=1, inContainer=true}, -- wg
{itemid=2278, count=1, inContainer=true} -- para
},
{ -- Paladin
{itemid=2004}, -- golden backpack
{itemid=2514}, -- mastermind shield
{itemid=7368}, -- assassin stars
{itemid=8891}, -- paladin armor
{itemid=2493}, -- demon helmet
{itemid=7730}, -- blue legs
{itemid=2268, count=1, inContainer=true}, -- sd
{itemid=2273, count=1, inContainer=true}, -- uh
{itemid=7590, count=1, inContainer=true}, -- gsp gmp
{itemid=7590, count=1, inContainer=true}, -- smp gmp
{itemid=7590, count=1, inContainer=true}, -- shp gmp
{itemid=2293, count=1, inContainer=true} -- mw
},
{ -- Knight
{itemid=2003}, -- grey backpack
{itemid=2509}, -- steel shield
{itemid=2400}, -- magic sword
{itemid=2431, inContainer=true}, -- stonecutter axe
{itemid=8928, inContainer=true}, -- obsidian truncheon
{itemid=2472}, -- magic plate armor
{itemid=2493}, -- demon helmet
{itemid=2470}, -- golden legs
{itemid=7590, count=1, inContainer=true}, -- mp gmp
{itemid=7590, count=1, inContainer=true}, -- ghp gmp
{itemid=7590, count=1, inContainer=true}, -- uhp gmp
{itemid=2313, count=1, inContainer=true}, -- explosion
{itemid=2293, count=1, inContainer=true} -- mw
}
}
]]></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>
Hey, I tried to use it, the items spawm, niice but they spawn on the floor ;-;
any idea/help?
Are you using TFS 0.3.6, released by otswe? It's probably bugged to hell. I'm unable to help you with that.
Is this one bugged to hell ?
[8.60] The Forgotten Server 0.3.6 (Crying Damson) V7
Started by Cyko, 4th January 2012 11:28
Because taht is the one im using, and i cant get this Firstitem.xml to work...
Yep, that is the one. Everyone who uses his TFS releases has issues with first items. Something must have been corrupted or messed up when he compiled it/edited it.
I made this script for TFS 0.3.7 - 9.46 or above. Sorry, I can't help because I have no idea what the problem is with his server.
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="2.0" author="J.Dre" contact="[email protected]" enabled="yes">
<config name="firstitems_config"><![CDATA[
commonItems = {
{itemid=6103, count=1, useMessage=true}, -- a book (or whatever) with a message
{itemid=2789, count=100, inContainer = true}, -- 100 brown mushrooms
{itemid=2160, count=10, inContainer = true}, -- 10 crystal coins
{itemid=2173, count=1}, -- AOL
{itemid=2195} -- BOH
}
firstItems = {
{ -- Sorcerer
{itemid=10522}, -- crown backpack
{itemid=8922}, -- WoV
{itemid=2656}, -- Brobe
{itemid=2323}, -- HotM
{itemid=7730}, -- B legs
{itemid=2534}, -- Vamp Shield
{itemid=7620, count=50, inContainer=true} -- mana potion
},
{ -- Druid
{itemid=10522}, -- crown backpack
{itemid=8910}, -- UWR
{itemid=2656}, -- Brobe
{itemid=2323}, -- HotM
{itemid=7730}, -- B legs
{itemid=2534}, -- Vamp Shield
{itemid=7620, count=50, inContainer=true} -- mana potion
},
{ -- Paladin
{itemid=11238}, -- Mino BP
{itemid=2399, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- Throwing Star
{itemid=8891}, -- pall armor
{itemid=2475}, -- Whelm
{itemid=2477}, -- K legs
{itemid=2534}, -- Vamp Shield
{itemid=7618, count=50, inContainer=true}, -- health potion
{itemid=7620, count=50, inContainer=true} -- mana potion
},
{ -- Knight
{itemid=10518}, -- Demon backpack
{itemid=2534}, -- Vamp Shield
{itemid=2430}, -- K axe
{itemid=7408, inContainer=true}, -- Wfang
{itemid=2434, inContainer=true}, -- Dhamma
{itemid=2487}, -- C armor
{itemid=2497}, -- Crus helm
{itemid=2488}, -- C legs
{itemid=7618, count=100, 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') .. ". !promotion = first promotion costs 1cc. !epic = epic promotion costs 20cc. !mushies = 100 brown mushrooms for 10 platinum coins |1k|. anymore questions msg help channel, or msg Reaper OR God Fut. Enjoy your time here at Futlend RL!\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>