president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Darkhaos" contact="None" enabled="yes">
<config name="firstitems_config"><![CDATA[
local items =
{
voc =
{
{
{2190}, -- wand of vortex
{2175}, -- spellbook
{8820}, -- mage hat
{8819}, -- mage robe
{2464} -- chain armor
},
{
{2182}, -- snakebite rod
{2175}, -- spellbook
{8820}, -- mage hat
{8819}, -- mage robe
{2464} -- chain armor
},
{
{2455}, -- crossbow
{2544}, -- arrow
{2463}, -- plate armor
{2647}, -- plate legs
{2457} -- steel helment
},
{
{2383}, -- spike sword
{2525}, -- dwarven shield
{2463}, -- plate armor
{2647} -- plate legs
}
},
all = {
{item = 2152, count = 25},
{item = 2643} -- leather boots
}
}
local storage = 67777
local c = nil
]]></config>
<event type="login" name="FirstItems" event="script"><![CDATA[
domodlib('firstitems_config')
function onLogin(cid)
if(getCreatureStorage(cid, storage) < 1 then
for i = 1, 4 do
if getPlayerVocation(cid) == i then
for t = 1, table.maxn(items.voc[i]) do
c = 1
if tonumber(items.voc[i][t].count) then
c = items.voc[i][t].count
end
doPlayerAddItem(cid, items.voc[i][t].item, c)
end
end
end
for i = 1, table.maxn(items.all) do
c = 1
if tonumber(items.all[i].count) then
c = items.all[i].count
end
doPlayerAddItem(cid, items.all[i].item, c)
end
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have received the " .. getVocationInfo(getPlayerVocation(cid)).name .. "'s first items.")
doCreatureSetStorage(cid, storage, 1)
end
return true
end
]]></event>
</mod>
thx all '-'
Error:
Assertion failed: m_scriptEnvIndex >= 0 && m_scriptEnvIndex <21, file ../luascript.h line 264