LazyWafflez Posted May 2, 2015 Share Posted May 2, 2015 Hi, I have been attempting to modify my game in an attempt to make it so when i pick a certain class I.E: Policeman. i would spawn with a pistol and some ammo, i can make it so that i spawn in with this if i am any class but i would like it so that if i pick a class i spawn with certain items relating to that class i would love to have some assistance from the community if i am worth your time Thank you Link to comment Share on other sites More sharing options...
RoboMat Posted May 2, 2015 Share Posted May 2, 2015 This should be all you need: ----- Adds items to the player's inventory, whenever-- he starts a new game.---- @param _player-- @param _sq--local function giveItems(_player, _sq) local p = _player; if p:HasTrait("butterfingers") then -- Check for the profession instead of for a trait p:getInventory():AddItems("Base.Popcorn", 2); p:getInventory():AddItems("Base.Pop", 1); endendEvents.OnNewGame.Add(giveItems);That's how I did it in my old player taunts mod, but I'm pretty sure this still works. Link to comment Share on other sites More sharing options...
LazyWafflez Posted May 2, 2015 Author Share Posted May 2, 2015 Thank you very much RoboMat Link to comment Share on other sites More sharing options...
LazyWafflez Posted May 2, 2015 Author Share Posted May 2, 2015 ive been trying your code and various iteration of it but i cannot figure out what i am doing wrong if p:HasProfession = "FireOfficer" then -- Check for the profession instead of for a traitgetPlayer():getInventory():AddItem("Base.Axe"); That is the code im trying to get working as just a test Link to comment Share on other sites More sharing options...
LazyWafflez Posted May 2, 2015 Author Share Posted May 2, 2015 Ive found a different problem for myself now i can get it working on certain professions but i cannot get it to work on others. There is only 4 that im trying to figure out ChefUnemployedBurglarRepairman elseif profession == "chef" thenplayer:getinventory():Additem("Base.Pot"); This is a bit of code im using and i cant find the problem for it if you get the chance could i have some assistance with the correct naming for those 4 professionsthank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now