• 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 What is wrong with my Firstitems!

Tofflarn

New Member
Joined
Mar 22, 2008
Messages
360
Reaction score
1
Location
Sweden
here is the code. i got alot of errors in my consol when i make a new character.. why ? :S What's wrong?

Code:
local firstItems = {
	2457,
	2463,
	2525,
	2647,
	2643
	}
local inBackpack = {
	2409,
	2120,
	2429,
	2190,
	7378,
	2394,
	2182
	}
function onLogin(cid)
	if getPlayerStorageValue(cid, 30001) == -1 then
		doPlayerAddItem(cid, 2152, 50)
		local bag = doPlayerAddItem(cid, 1988, 1)
		for i = 1, table.maxn(firstItems) do
			doPlayerAddItem(cid, firstItems[i], 1)
		end
		for i = 1, table.maxn(inBackpack) do
			doAddContainerItem(bag, inBackpack[i], 1)
		end
		setPlayerStorageValue(cid, 30001, 1)
	end
 	return TRUE
end
 
@up That's why he asked you m****.
@tofflarn
In my eyes it looks fine, but I will try to help u later, going to bed now, see u.
 
here is the code. i got alot of errors in my consol when i make a new character.. why ? :S What's wrong?

Code:
local firstItems = {
    2457,
    2463,
    2525,
    2647,
    2643
    }
local inBackpack = {
    2409,
    2120,
    2429,
    2190,
    7378,
    2394,
    2182
    }
function onLogin(cid)
    if getPlayerStorageValue(cid, 30001) == -1 then
        doPlayerAddItem(cid, 2152, 50)
        local bag = doPlayerAddItem(cid, 1988, 1)
        for i = 1, table.maxn(firstItems) do
            doPlayerAddItem(cid, firstItems[i], 1)
        end
        for i = 1, table.maxn(inBackpack) do
            doAddContainerItem(bag, inBackpack[i], 1)
        end
        setPlayerStorageValue(cid, 30001, 1)
    end
     return TRUE
end

Could you post the error messages then? It would help quite much.. :)
 
Ofc im using Tfs ;)
And i only get 4 items in my bp :S
Errors:

Code:
[15/09/2008  11:43:24] Epanthesecond has logged in.

[15/09/2008  11:43:24] Lua Script Error: [CreatureScript Interface] 
[15/09/2008  11:43:24] data/creaturescripts/scripts/firstitems.lua:onLogin

[15/09/2008  11:43:24] luaDoAddContainerItem(). Could not add item

[15/09/2008  11:43:24] Lua Script Error: [CreatureScript Interface] 
[15/09/2008  11:43:24] data/creaturescripts/scripts/firstitems.lua:onLogin

[15/09/2008  11:43:24] luaDoAddContainerItem(). Could not add item

[15/09/2008  11:43:24] Lua Script Error: [CreatureScript Interface] 
[15/09/2008  11:43:24] data/creaturescripts/scripts/firstitems.lua:onLogin

[15/09/2008  11:43:24] luaDoAddContainerItem(). Could not add item
 
Haha I spent like 30 minutes trying to figure out what was wrong then I figured it out...you're out of cap after the first 4 items, so there's no room for the remaining 3.

Jo3
 
Back
Top