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

Windows Firstitems.lua

H3ll0

New Member
Joined
Sep 24, 2010
Messages
16
Reaction score
1
hey im trying to change the firstitems.lua so that the rook player gets a leather set wooden shield and a sword i dont realy care about the others vocations cuz you cant choose them.
when you start youre a no vocation. can anyone help me? :X
Code:
function onLogin(cid)
if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
if isSorcerer(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)

doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 3)

doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2190, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)

setPlayerStorageValue(cid, 50000, 1)

elseif isDruid(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 3)

doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2182, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)

setPlayerStorageValue(cid, 50000, 1)

elseif isPaladin(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 3)

doPlayerAddItem(cid, 2389, 3)
doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2643, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2463, 1)
setPlayerStorageValue(cid, 50000, 1)

elseif isKnight(cid) then
local bag = doPlayerAddItem(cid, 9774, 1)
doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 3)
doAddContainerItem(bag, 8601, 1)
doAddContainerItem(bag, 2383, 1)
doAddContainerItem(bag, 2417, 1)


doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)

setPlayerStorageValue(cid, 50000, 1)
end
end
return TRUE
end
 
Just remove the if isSorcerer(cid) then, elseif isDruid(cid) then and the end at the bottom. Then you just use the code you have to add the items you want with the correct itemId.

Code:
function onLogin(cid)
if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then

local bag = doPlayerAddItem(cid, 9774, 1)

doAddContainerItem(bag, 2120, 1)
doAddContainerItem(bag, 2554, 1)
doAddContainerItem(bag, 2160, 3)

doPlayerAddItem(cid, 2525, 1)
doPlayerAddItem(cid, 2190, 1)
doPlayerAddItem(cid, 2463, 1)
doPlayerAddItem(cid, 2457, 1)
doPlayerAddItem(cid, 2647, 1)
doPlayerAddItem(cid, 2643, 1)

setPlayerStorageValue(cid, 50000, 1)
end
return TRUE
end

Change the ID's to the items you need.
 
Looks Crappy But Will Work :)
here a better version And Shorten
Code:
function onLogin(cid)
if getPlayerStorageValue(cid, 50000) == -1 then
local items = {2525,2190,2463,2457,2647,2643}
local containeritems = {2120,2554}
local bag = doPlayerAddItem(cid, 9774, 1)
for t = 1, #containersitems do
doAddContainerItem(bag, t, 1)
doAddContainerItem(bag, 2160, 3)
end
for i = 1,#items do
doPlayerAddItem(cid, i, 1)
end
setPlayerStorageValue(cid, 50000, 1)
end
return true
end
 
Back
Top