xx Kami xx
Retired.
- Joined
- Dec 29, 2012
- Messages
- 509
- Reaction score
- 20
hello can someone fix this script for me?
Edit; This is the error i get
Will Rep+++ if anyone can fix!! it wont work for me
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Firstitems" 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=100, inContainer = true}, -- 100 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}
{itemid=1967, count=1, inContainer = true}
{itemid=8976, count=1, inContainer = true}
}
firstItems = {
{ -- Sorcerer
{itemid=1988}, -- backpack
{itemid=3975}, -- spellbook
{itemid=7426}, -- wand of vortex
{itemid=2505}, -- magician's robe
{itemid=7461}, -- mage hat
{itemid=2507}, -- legs
{itemid=2358}, -- boots
{itemid=2173}, -- aol
{itemid=2300, count=1, inContainer=true} -- mana potion
},
{ -- Druid
{itemid=1988}, -- backpack
{itemid=3975}, -- spellbook
{itemid=7958}, -- wand of vortex
{itemid=2505}, -- magician's robe
{itemid=7461}, -- mage hat
{itemid=2507}, -- studded legs
{itemid=2358}, -- boots
{itemid=2173}, -- aol
{itemid=2300, count=1, inContainer=true} -- mana potion
},
{ -- Paladin
{itemid=1988}, -- backpack
{itemid=7438, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- 7438
{itemid=2352, count=1, useSlot=true, slotType=CONST_SLOT_LAST}, -- 1 arrow
{itemid=2505}, -- ranger's cloak
{itemid=7461}, -- soldier helmet
{itemid=2507}, -- ranger legs
{itemid=2358}, -- boots
{itemid=2173}, -- aol
{itemid=2296, count=1, inContainer=true}
},
{ -- Knight
{itemid=1988}, -- backpack
{itemid=3975}, -- steel shield
{itemid=7416}, -- jagged sword
{itemid=7435, inContainer=true}, -- steel axe
{itemid=2505}, -- brass armor
{itemid=7461}, -- soldier helmet
{itemid=2507}, -- brass legs
{itemid=2358}, -- boots
{itemid=2173}, -- aol
{itemid=2296, 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>
Edit; This is the error i get
Will Rep+++ if anyone can fix!! it wont work for me