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

[Help] Firstitems.lua

Alucard

New Member
Joined
Nov 18, 2007
Messages
17
Reaction score
0
Hey, I need some help with firstitems.lua. I am trying to figure out how to add more items to the backpack (and the amount of it offcourse) but when I change
Code:
		local bag = doPlayerAddItem(cid, 1987, 1)
		doAddContainerItem(bag, 2674, 1)
		setPlayerStorageValue(cid, 30001, 1)

to
Code:
		local bag = doPlayerAddItem(cid, 1988, 1)
		doAddContainerItem(bag, 2674, 10)
		setPlayerStorageValue(cid, 30001, 1)

it doesn't seem to be working. So can anybody tell me what I'm doing wrong?
 
Hey everyone. I'm having a problem, could you guys help me? This may sound noob, but I've tried everything.

This is what I have in firstitems.lua

local firstItems =
{
2530,
2395,
2464,
2458,
2648,
2643

}

function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems) do
doPlayerAddItem(cid, firstItems, 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2120, 1)
end
local bag = doPlayerAddItem(cid, 1987, 1)
doAddContainerItem(bag, 2182, 1)
doAddContainerItem(bag, 2190, 1)
doAddContainerItem(bag, 2388, 1)
doAddContainerItem(bag, 2456, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end


And this is what I keep getting...

[02/07/2008 18:27:42] Lua Script Error: [CreatureScript Interface]
[02/07/2008 18:27:42] data/creaturescripts/scripts/firstitems.lua:eek:nLogin

[02/07/2008 18:27:42] luaDoAddContainerItem(). Could not add item

[02/07/2008 18:27:42] Lua Script Error: [CreatureScript Interface]
[02/07/2008 18:27:42] data/creaturescripts/scripts/firstitems.lua:eek:nLogin

[02/07/2008 18:27:42] luaDoAddContainerItem(). Could not add item

Thanks in advance!
 
Last edited:
Use this script instead: (Be sure to change for vocs)

Code:
function onStepIn(cid, item, pos)

--No Vocation
    if getPlayerStorageValue(cid, 3169) == -1 and getPlayerVocation(cid) == 0 then
        doPlayerAddItem(cid, 2512, 1) -- wooden shield
        doPlayerAddItem(cid, 2376, 1) -- sword
        doPlayerAddItem(cid, 2467, 1) -- leather armor
        doPlayerAddItem(cid, 2643, 1) -- leather boots
        doPlayerAddItem(cid, 2649, 1) -- leather legs
        doPlayerAddItem(cid, 2461, 1) -- leather helmet
        doPlayerAddItem(cid, 1998, 1) -- backpack
	doPlayerAddItem(cid, 2789, 100) -- brown mushrooms
    setPlayerStorageValue(cid, 3169, 1)
	
	
-- Sorcerer	
    elseif getPlayerStorageValue(cid, 3169) == -1 and getPlayerVocation(cid) == 1 then
        doPlayerAddItem(cid, 2515, 1) -- guardian shield
        doPlayerAddItem(cid, 2187, 1) -- wand of inferno
        doPlayerAddItem(cid, 2656, 1) -- blue robe
        doPlayerAddItem(cid, 2195, 1) -- boh
        doPlayerAddItem(cid, 2647, 1) -- plate legs
        doPlayerAddItem(cid, 2491, 1) -- crown helmet
        doPlayerAddItem(cid, 1998, 1) -- backpack
	doPlayerAddItem(cid, 2789, 100) -- brown mushrooms
        doPlayerAddItem(cid, 2273, 1) -- ultimate healing rune
        doPlayerAddItem(cid, 2313, 1) -- explosion rune
        doPlayerAddItem(cid, 2268, 1) -- sudden death rune
    setPlayerStorageValue(cid, 3169, 1)
	

-- Druid
    elseif getPlayerStorageValue(cid, 3169) == -1 and getPlayerVocation(cid) == 2 then
        doPlayerAddItem(cid, 2515, 1) -- guardian shield
        doPlayerAddItem(cid, 2183, 1) -- tempest rod
        doPlayerAddItem(cid, 2656, 1) -- blue robe
        doPlayerAddItem(cid, 2195, 1) -- boh
        doPlayerAddItem(cid, 2647, 1) -- plate legs
        doPlayerAddItem(cid, 2491, 1) -- crown helmet
        doPlayerAddItem(cid, 1998, 1) -- backpack
        doPlayerAddItem(cid, 2789, 100) -- brown mushrooms		
        doPlayerAddItem(cid, 2273, 1) -- ultimate healing rune
        doPlayerAddItem(cid, 2313, 1) -- explosion rune
        doPlayerAddItem(cid, 2268, 1) -- sudden death rune
    setPlayerStorageValue(cid, 3169, 1)

	
-- Paladin
    elseif getPlayerStorageValue(cid, 3169) == -1 and getPlayerVocation(cid) == 3 then
        doPlayerAddItem(cid, 2455, 1) -- crossbow
        --doPlayerAddItem(cid, 2376, 1) not used
        doPlayerAddItem(cid, 2476, 1) -- knight armor
        doPlayerAddItem(cid, 2195, 1) -- boh
        doPlayerAddItem(cid, 2477, 1) -- knight legs
        doPlayerAddItem(cid, 2475, 1) -- warrior helmet
        doPlayerAddItem(cid, 1998, 1) -- backpack
        doPlayerAddItem(cid, 2547, 100) -- bolts
	doPlayerAddItem(cid, 2789, 100) -- brown mushrooms
        doPlayerAddItem(cid, 2273, 1) -- ultimate healing rune
        doPlayerAddItem(cid, 2311, 1) -- heavy magic missile
    setPlayerStorageValue(cid, 3169, 1)

	
-- Knight
    elseif getPlayerStorageValue(cid, 3169) == -1 and getPlayerVocation(cid) == 4 then
        doPlayerAddItem(cid, 2519, 1) -- crown shield
        doPlayerAddItem(cid, 2431, 1) -- stonecutter axe
        doPlayerAddItem(cid, 2487, 1) -- crown armor
        doPlayerAddItem(cid, 2195, 1) -- boh
        doPlayerAddItem(cid, 2488, 1) -- crown legs
        doPlayerAddItem(cid, 2497, 1) -- crusader helmet
        doPlayerAddItem(cid, 1998, 1) -- backpack
	doPlayerAddItem(cid, 2789, 100) -- brown mushrooms
        doPlayerAddItem(cid, 2273, 1) -- ultimate healing rune
        doPlayerAddItem(cid, 2311, 1) -- heavy magic missile
        doPlayerAddItem(cid, 2313, 1) -- explosion rune
    setPlayerStorageValue(cid, 3169, 1)
		
    end
end
 
Back
Top