4Muki4
HOROHOROHORO
- Joined
- May 1, 2012
- Messages
- 757
- Reaction score
- 72
Dear Members,
i installed today J.Dre's frist items but comes an console error Here it is:
rep++ of course
- - - Updated - - -
Script:
i installed today J.Dre's frist items but comes an console error Here it is:
Code:
[16/08/2012 07:40:13] [Error - CreatureScript Interface]
[16/08/2012 07:40:13] buffer
[16/08/2012 07:40:13] Description:
[16/08/2012 07:40:13] [string " commonItems = {..."]:5: '}' expected (to close '{' at line 1) near '{'
[16/08/2012 07:40:13] [Error - CreatureScript Interface]
[16/08/2012 07:40:13] buffer
[16/08/2012 07:40:13] Description:
[16/08/2012 07:40:13] [string "loadBuffer"]:3: bad argument #1 to 'ipairs' (table expected, got nil)
[16/08/2012 07:40:13] [Warning - Event::loadScript] Cannot load script ( domodlib('firstitems_config')
[16/08/2012 07:40:13]
[16/08/2012 07:40:13] for _, items in ipairs(firstItems) do
[16/08/2012 07:40:13] for _, item in ipairs(commonItems) do
[16/08/2012 07:40:13] table.insert(items, item)
[16/08/2012 07:40:13] end
[16/08/2012 07:40:13] end
[16/08/2012 07:40:13]
[16/08/2012 07:40:13] function onLogin(cid)
[16/08/2012 07:40:13] if(getPlayerAccess(cid) < 3 and (getPlayerLastLoginSaved(cid) < 1) and firstItems[getPlayerVocation(cid)]) then
[16/08/2012 07:40:13] for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
[16/08/2012 07:40:13] if isItemContainer(v.itemid) then
[16/08/2012 07:40:13] backpack = doPlayerAddItem(cid, v.itemid, 1, false)
[16/08/2012 07:40:13] elseif v.inContainer then
[16/08/2012 07:40:13] doAddContainerItem(backpack, v.itemid, v.count or 1)
[16/08/2012 07:40:13] elseif v.useSlot then
[16/08/2012 07:40:13] doPlayerAddItem(cid, v.itemid, v.count, false, v.slotType)
[16/08/2012 07:40:13] elseif v.useMessage then
[16/08/2012 07:40:13] local t, k = {
[16/08/2012 07:40:13] writer = "Server Staff", date = os.time(),
[16/08/2012 07:40:13] 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!"
[16/08/2012 07:40:13] }, doPlayerAddItem(cid, v.itemid, v.count or 1, false)
[16/08/2012 07:40:13] doSetItemText(k, t.text, t.writer, t.date)
[16/08/2012 07:40:13] else
[16/08/2012 07:40:13] doPlayerAddItem(cid, v.itemid, v.count or 1)
[16/08/2012 07:40:13] end
[16/08/2012 07:40:13] end
[16/08/2012 07:40:13] end
[16/08/2012 07:40:13]
[16/08/2012 07:40:13] return true
[16/08/2012 07:40:13] end
[16/08/2012 07:40:13] )
rep++ of course
- - - Updated - - -
Script:
Code:
<?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=2789, count=10, inContainer = true}, -- 10 brown mushrooms
{itemid=2152, count=10, inContainer = true}, -- 10 platinum coins
{itemid=2643} -- leather boots
{itemid=2305, count=1, inContainer = true}, -- fire bomb rune
{itemid=2261, count=1, inContainer = true}, -- destroy field rune
{itemid=2120, count=1, inContainer = true}, -- rope
{itemid=5710, count=1, inContainer = true}, -- shovel
}
firstItems = {
{ -- Sorcerer
{itemid=1988}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2187}, -- wand of inferno
{itemid=8819}, -- magician's robe
{itemid=2457}, -- steel helemet
{itemid=2463}, -- plate legs
{itemid=2268, count=1, inContainer=true} -- sd
{itemid=2293, count=1, inContainer=true} -- mw
{itemid=7590, count=1, inContainer=true} -- gmp
{itemid=2274, count=1, inContainer=true} -- ava
},
{ -- Druid
{itemid=1988}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2183}, -- hailstrom rod
{itemid=8819}, -- magician's robe
{itemid=2457}, -- steel helemet
{itemid=2463}, -- plate legs
{itemid=2268, count=1, inContainer=true} -- sd
{itemid=2293, count=1, inContainer=true} -- mw
{itemid=2269, count=1, inContainer=true} -- wg
{itemid=7590, count=1, inContainer=true} -- gmp
{itemid=2274, count=1, inContainer=true} -- ava
},
{ -- Paladin
{itemid=1988}, -- backpack
{itemid=2399}, -- star
{itemid=2660}, -- ranger's cloak
{itemid=2481}, -- soldier helmet
{itemid=8923}, -- ranger legs
{itemid=8472, count=1, inContainer=true}, -- Great spirit Potion
{itemid=7589, count=1, inContainer=true} -- strong mana potion
{itemid=2268, count=1, inContainer=true} -- sd
{itemid=2293, count=1, inContainer=true} -- mw
{itemid=7620, count=1, inContainer=true} -- mp
},
{ -- Knight
{itemid=1988}, -- backpack
{itemid=2509}, -- steel shield
{itemid=2400}, -- magic sword
{itemid=2465}, -- brass armor
{itemid=2481}, -- soldier helmet
{itemid=2478}, -- brass legs
{itemid=8473, count=1, inContainer=true} -- uhp
{itemid=2293, count=1, inContainer=true} -- mw
{itemid=7620, count=1, inContainer=true} -- mp
}
}
]]></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>