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

starting items help PLEASE! REP++

brank50

New Member
Joined
Dec 14, 2009
Messages
78
Reaction score
1
when someone logs in they dont get anything i have the firstitems.lua and its added in on my creatureevents.xml and still dont work so maybe one of yall can fix it???????? im also using a website not a account manager read the post above this one!

[function onDeath(cid, corpse, deathList)
if getCreatureSkullType(cid) >= SKULL_RED then
doCreatureSetStorage(cid, 99, 1)
end
return true
end

local t = {
{2000}, -- red bp
{7591}, -- great health potion
{7589}, -- strong mana potion
{8472}, -- great spirit potion
{2268}, -- sudden death rune
{2120}, -- rope
{2420}, -- machete
{2789, 50}, -- brown mushrooms
{2195}, -- boots of haste
{8922}, -- wand of voodoo
{8910}, -- underworld rod
{7368, 100}, -- assassin stars
{2400}, -- magic sword
{2421}, -- thunder hammer
{2431}, -- Stonecutter Axe
{2522}, -- great shield
}

function onLogin(cid)
if getCreatureStorage(cid, 99) == 1 then
doCreatureSetStorage(cid, 99)
for _, f in ipairs(t) do
doPlayerAddItem(cid, f[1], f[2] or 1)
end
end
return true
end

<event type="login" name="Firstitems" event="script" value="firstitems.lua"/>
please help!
 
Here is my script.. All you need to do is paste it into your first items and edit your item ID's.
If the server console has any problems and says something about 'Storage'... All you need to do is change the number at "STORAGE"
This is from a MODS folder.. So all you could do is delete the file you have. Make a file in your 'Mods' folder called 'firstitems' and paste that in there, then edit.

LUA:
 <?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" enabled="yes">
<config name="firstitems_config"><![CDATA[
STORAGE = 30002
commonItems = {
{itemid=2160, count=5, inContainer = true}, -- 2 platinum coins
{itemid=2643}, -- boots
{itemid=2173}, -- aol
}
firstItems = {
{ -- Sorcerer
{itemid=1988}, -- backpack
{itemid=2518}, -- shield
{itemid=2190}, -- wand
{itemid=8870}, -- armor
{itemid=2457}, -- helmet
{itemid=2647} -- legs
},
{ -- Druid
{itemid=1988}, -- backpack
{itemid=2518}, -- shield
{itemid=2182}, -- rod
{itemid=8870}, -- armor
{itemid=2457}, -- helmet
{itemid=2647} -- legs
},
{ -- Paladin
{itemid=1988}, -- backpack
{itemid=2518}, -- shield
{itemid=7378}, -- weapon
{itemid=8872}, -- armor
{itemid=2457}, -- helmet
{itemid=2647} -- legs
},
{ -- Knight
{itemid=1988}, -- backpack
{itemid=2518}, -- shield
{itemid=2412}, -- weapon
{itemid=8601, inContainer = true},
{itemid=2398, inContainer = true},
{itemid=2463}, -- armor
{itemid=2457}, -- helmet
{itemid=2647} -- legs
}
}
]]></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 getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 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)
elseif v.inContainer then
doAddContainerItem(backpack, v.itemid, v.count or 1)
else
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
end
setPlayerStorageValue(cid, STORAGE, 1)
end
return true
end
]]></event>
</mod>
 
The thing beerabbit5 posted is not a lua script it is a mod that should be in a .xml file (a new one) and be putted in mod/ folder :)

Just replace the text in your present firstitems.xml with the text that beerabbit5 wrote.

@Siramix his first script is a .lua and not a .xml :p
 
Back
Top