• 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 Script problem

zednem

New Member
Joined
Nov 15, 2008
Messages
108
Reaction score
0
I was trying to make this script, but i having this error
"luaDoAddPlayer <> Not FOund"
and i have no ideia why
someome can help me?

local druiditems = {8819, 8820, 2468, 2509, 2643, 2182}
local sorcitems = {8819, 8820, 2468, 2509, 2643, 2190}
local knightitems = {2643, 2478, 2465, 2481, 2509}
local paladinitems = {2509, 2643, 8923, 8892, 2481, 2389}
local voc = getPlayerVocation(cid)
local bp = doPlayerAddItem(cid, 1988, 1)

function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then

if voc == 1 then
for i = 1, table.maxn(sorcitems) do
doPlayerAddItem(cid, sorcitems, 1)
doAddContainerItem(bp, 2152, 20)
doAddContainerItem(bp, 2789, 10)
setPlayerStorageValue(cid, 30001, 1)
end

if voc == 2 then
for i = 1, table.maxn(druiditems) do
doPlayerAddItem(cid, druiditems, 1)
doAddContainerItem(bp, 2152, 20)
doAddContainerItem(bp, 2789, 10)
setPlayerStorageValue(cid, 30001, 1)
end

if voc == 3 then
for i = 1, table.maxn(paladinitems) do
doPlayerAddItem(cid, paladinitems, 1)
doAddContainerItem(bp, 2152, 20)
doAddContainerItem(bp, 2789, 10)
setPlayerStorageValue(cid, 30001, 1)
end

if voc == 4 then
for i = 1, table.maxn(knightitems) do
doPlayerAddItem(cid, knightitems, 1)
doAddContainerItem(bp, 2152, 20)
doAddContainerItem(bp, 2789, 10)
doAddContainerItem(bp, 8602, 1)
doAddContainerItem(bp, 8601, 1)
doAddContainerItem(bp, 2439, 1)
setPlayerStorageValue(cid, 30001, 1)
end
end
end
end
end
end
return TRUE
end
 
Try this one:
Code:
local items = { 
	[1] = { 8819, 8820, 2468, 2509, 2643, 2190 },
	[2] = { 8819, 8820, 2468, 2509, 2643, 2182 },
	[3] = { 2509, 2643, 8923, 8892, 2481, 2389 },
	[4] = { 2643, 2478, 2465, 2481, 2509 }
}
function onLogin(cid)
	if getPlayerStorageValue(cid, 30001) == -1 then
		for voc, item in pairs(items) do
			if getPlayerVocation(cid) == voc then
				local container = doPlayerAddItem(cid, 1988, 1)
				for i = 1, table.maxn(item) do
					doAddContainerItem(container, item[i], 1)
				end
				setPlayerStorageValue(cid, 30001, 1)
			end
		end
	end
	return TRUE
end
 
Last edited:
Thanks dude!!
Worked now :D :D
but i have a question the items started inside backpack, there is a way to items starts at right places?
 
Back
Top