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

[Lua] Creature Script Login items!

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,775
Solutions
25
Reaction score
483
Location
Sweden
Hi there, i need help with this script. First of all I want to get a backpack with rope, shovel, 10 brown mushroom.

Here's the script:

Lua:
local firstItems =
{
}

function onLogin(cid)
	if getPlayerStorageValue(cid, 30001) == -1 then
		for i = 1, table.maxn(firstItems) do
			doPlayerAddItem(cid, firstItems[i], 1)
		end
		if getPlayerSex(cid) == 0 then
			doPlayerAddItem(cid, 2464, 1)
		else
			doPlayerAddItem(cid, 2464, 1)
		end
		local backpack = doPlayerAddItem(cid, 1988, 1)
		doAddContainerItem(backpack, 2789, 10)
		setPlayerStorageValue(cid, 30001, 1)
	end
 	return TRUE
end

Thanks.
 
Code:
local backpack_items = {
	2120,
	2121,
	2122
}


local items = {
	2160,
	2152,
	2148
}

function onLogin(cid)
        if getPlayerStorageValue(cid, 30001) == -1 then
		local backpack = doPlayerAddItem(cid, 1988, 1)
		for i = 1, #backpack_items do
			doAddContainerItem(backpack, backpack_items[i], 1)
		end
		for i = 1, #items do
			doPlayerAddItem(cid, items[i], 1)
		end
		setPlayerStorageValue(cid, 30001, 1)
	end
	return true
end
 
Back
Top