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

Solved Probable Easy Fix! (Starting Items)

What should it all have? This is one I made a while ago for someone.
Code:
local vocitems = {
   [1] = {
     container = {{id = 2120, count = 1}, {id = 2554, count = 1}, {id = 2160, count = 5}},
     eq = {2525, 2190, 2463, 2457, 2647, 2643}
   },
   [2] = {
     container = {{id = 2120, count = 1}, {id = 2554, count = 1}, {id = 2160, count = 5}},
     eq = {2525, 2182, 2463, 2457, 2647, 2643}
   },
   [3] = {
     container = {{id = 2120, count = 1}, {id = 2554, count = 1}, {id = 2160, count = 5}},
     eq = {2389, 2525, 2457, 2463, 2647, 2643}
   },
   [4] = {
     container = {{id = 2120, count = 1}, {id = 2554, count = 1}, {id = 2160, count = 5}},
     eq = {2525, 8601, 2463, 2457, 2647, 2643}
   }
}

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], 1)
       end
       local bag = doPlayerAddItem(cid, 9774, 1)
       for c = 1, #x.container do
         doAddContainerItem(bag, x.container[c].id, x.container[c].count)
       end
     end
   end
   return true
end
 
Also - Adding that script did nothing :( Is there something else I have to disable for this to be active?

For all: plate armor, plate legs, steel helmet, dwarven shield, leather boots

Druid: Snakebite Rod
Paladin: 10 Spears
Sorcerer: Wand of Vortex
Knight: Knight Serpent Sword


Any help with that would be epic :D
 
Last edited:
You could probably do that yourself, changing item ID's is not that hard? :p
 
Yeah no, IDs aren't hard. The hard part is getting the actual script to do something. When they start - They get the standart lvl 1 gear (Unless that what BOTH script's I've tried had.)
 
Did you reload creaturescripts after you changed the content of firstitems.lua? Because default firstitems.lua for TFS 1.0 gives standard equipment (jacket/coat, club, torch and apple) on first login.
 
Maybe you forgot to save it or changed the wrong script.

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
I changed the table a bit, maybe it's more easy to understand like this.
Also added count to eq for the spears.
If you want to change the items, you can just change the ids in the table.
 
Nope, It definatly saved as I clicked 4 times :D

What items exactly are on the script you gave me? The default items or something special, so that I can check that the script atleast works for me?


Thanks alot for making it clearer aswell, epic :D

edit: I've edited all items in. We'll see if it works in a few minutes :D

edit 2: Did not work :/
 
Last edited:
Atm it gives plate set, steel helmet, dwarven shield and leather boots to every vocation, wand of vortex for the sorcerer, snakebit rod for the druid, 5 spears for the paladin and serpent sword for the knight.
They all get a rope, shovel and an apple in their bp.


Edit: Problem solved in Teamviewer.
 
Last edited:
Back
Top