• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved First items?

Byte

* * * * *
Joined
Jul 23, 2013
Messages
130
Reaction score
19
Location
???
Using OTHire does anyone have a script for firstitems.lua? the one I tried does not work:

Code:
local vocitems = {
   [1] = { -- sorcerer
     container = {
       {id = 2120, count = 1},
       {id = 2554, count = 1},
       {id = 2674, count = 1}
     },
     eq = {
       {id = 2525, count = 1},
       {id = 2190, count = 1},
       {id = 2457, count = 1},
       {id = 2463, count = 1},
       {id = 2647, count = 1},
       {id = 2643, count = 1}
     }
   },
   [2] = { -- druid
     container = {
       {id = 2120, count = 1},
       {id = 2554, count = 1},
       {id = 2674, count = 1}
     },
     eq = {
       {id = 2525, count = 1},
       {id = 2182, count = 1},
       {id = 2457, count = 1},
       {id = 2463, count = 1},
       {id = 2647, count = 1},
       {id = 2643, count = 1}
     }
   },
   [3] = { -- paladin
     container = {
       {id = 2120, count = 1},
       {id = 2554, count = 1},
       {id = 2674, count = 1}
     },
     eq = {
       {id = 2525, count = 1},
       {id = 2389, count = 5},
       {id = 2457, count = 1},
       {id = 2463, count = 1},
       {id = 2647, count = 1},
       {id = 2643, count = 1}
     }
   },
   [4] = { -- knight
     container = {
       {id = 2120, count = 1},
       {id = 2554, count = 1},
       {id = 2674, count = 1}
     },
     eq = {
       {id = 2525, count = 1},
       {id = 2409, count = 1},
       {id = 2457, count = 1},
       {id = 2463, count = 1},
       {id = 2647, count = 1},
       {id = 2643, count = 1}
     }
   }
}

function onLogin(cid)

   if(getPlayerLastLoginSaved(cid) == 0) then
     local x = vocitems[getPlayerVocation(cid)]
     if x then
       for e = 1, #x.eq do
         doPlayerAddItem(cid, x.eq[e].id, x.eq[e].count)
       end
       local bag = doPlayerAddItem(cid, 2000, 1)
       for c = 1, #x.container do
         doAddContainerItem(bag, x.container[c].id, x.container[c].count)
       end
     end
   end
   return true
end
 
Try to change getPlayerLastLoginSaved for storage.
Example
Code:
if getPlayerStorageValue(cid, 67821) ~= 1 then
Then above the end that closes the if statement.
Code:
setPlayerStorageValue(cid, 67821, 1)
If you still have problems, explain what happens, how you added it and if you get errors.
 
Back
Top