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

Solved Problem first items :/

bolero

MikeHere
Joined
Apr 13, 2009
Messages
1,146
Reaction score
12
Location
Venezuela
Hey guys, my players when enter don't have noob items >.<

Don't have equip.

What I need to fix this? :/

Y try put firstitems.lua in creaturescripts and doesn't working.
 
Last edited:
MOD:


Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 30001,
			items = {2050, 2382}
		}
	]]></config>
	<event type="login" name="FirstItems" event="buffer"><![CDATA[
		domodlib('firstitems_config')
		if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end

		for _, id in ipairs(config.items) do
			doPlayerAddItem(cid, id, 1)
		end

		if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
			doPlayerAddItem(cid, 2651, 1)
		else
			doPlayerAddItem(cid, 2650, 1)
		end

		doAddContainerItem(doPlayerAddItem(cid, 1987, 1), 2674, 1)
		setPlayerStorageValue(cid, config.storage, 1)
	]]></event>
</mod>
 
Doesn't work :/

dibujoypj.jpg
 
Just add weapons for it. Or you can change ids of items.

creaturescripts/scripts/firstitems.lua

Code:
local firstItems = {}
firstItems[0] =
{
2173,
2525,
3965,
2124,
2457,
2647,
2643
}
firstItems[1] =
{
2173,
2525,
2124,
8820,
2649,
2643,
8819
}
firstItems[2] =
{
2173,
2525,
2124,
8820,
2649,
2643,
8819
}
firstItems[3] =
{
2173,
2525,
2124,
2460,
8923,
2643,
2660,
}
firstItems[4] =
{
2173,
2525,
2124,
2460,
2478,
2643,
2465
}

function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do
doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)][i], 1)
end
local bag = doPlayerAddItem(cid, 10521, 1)
doAddContainerItem(bag, 2160, 2)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 7618, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
 
Back
Top