• 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 with starting items.

Herkuleze

New Member
Joined
May 28, 2010
Messages
9
Reaction score
1
Hi, im new to making an OT. i have most everything set up. the problem im running into right now is how to script in the Starting items. When people log in they are naked.
 
Just wrote something quick. You have to set the correct IDs yourself

Code:
function onLogin(cid)
   
    local s = getPlayerStorageValue(100)
    local v = getPlayerVoction(cid)
    if s < 1 then
        local b = doPlayerAddItem(cid, 1988, 1)
        if v == 1 then
            doPlayerAddItem(cid, 2400, 1)
        elseif v == 2 then
            doPlayerAddItem(cid, 2400, 1)
        elseif v == 3 then
            doPlayerAddItem(cid, 2400, 1)
        elseif v == 4 then
            doPlayerAddItem(cid, 2400, 1)
        end
        doAddContainerItem(b, 2120, 1)
        setPlayerStorageValue(cid, 100, 1)
    end
    return true
end
 
Hi, im new to making an OT. i have most everything set up. the problem im running into right now is how to script in the Starting items. When people log in they are naked.

data/creaturescripts/scripts/firstitems.lua
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, 2152, 10)

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
data/creaturescripts/creaturescripts.xml
Code:
<event type="login" name="FirstItems" script="firstitems.lua"/>
data/creaturescripts/scripts/login.lua
Code:
registerCreatureEvent(cid, "firstitems")
 
Back
Top