Project Zomboid

Project Zomboid

10 Years Later Professions and Occupations
Tgraves710x 2023 年 7 月 21 日 上午 11:04
Starting items for profession not working (fixed)
the starting items weren't working and i realized it later in my playthroughs and it was getting slightly annoying so i fixed it, the code is as follows for the patched code, (edit) with the professions spawn items being corrected instead of just having something that doesnt fit its profession (end of edit) (another edit) to implement this code you go in you files to
-Your drive you download workshop things to-
(Yet another edit) I'm active on discord so you can mention me there or dm me! (My discord is tgraves)
"Steam\steamapps\workshop\content\108600\2856961307\mods\10YearslaterOccupationsSpawnItems\media\lua\client"
for me i had to go to "C:\ProgramFiles(x86)\Steam\steamapps\workshop\content\108600\2856961307\mods\10YearslaterOccupationsSpawnItems\media\lua\client" which is my computer/laptops HardDrive (end of extra edit)
Events.OnNewGame.Add(function(player, square) if player then local prof = player:getDescriptor():getProfession() if prof == "unemployed" then player:getInventory():AddItem("") end -- Common Survivor if prof == "common" then player:getInventory():AddItem("Base.Crowbar") player:getInventory():AddItem("Base.CannedSardines") end if prof == "hardened" then player:getInventory():AddItem("Base.Axe") player:getInventory():AddItem("Base.TinnedBeans") end if prof == "sharpshooter" then player:getInventory():AddItem("Base.AssaultRifle2") player:getInventory():AddItem("Base.308Box") player:getInventory():AddItem("Base.M14Clip") end if prof == "medic" then player:getInventory():AddItem("Base.FirstAidKit") local medkit = player:getInventory():getItemFromType("Base.FirstAidKit") if medkit then local baginv = medkit:getItemContainer() baginv:AddItem("Base.Pills") baginv:AddItem("Base.Bandage") baginv:AddItem("Base.SutureNeedle") baginv:AddItem("Base.Tweezers") baginv:AddItem("Base.Needle") baginv:AddItem("Base.CottonBalls") baginv:AddItem("Base.Thread") baginv:AddItem("Base.Scalpel") baginv:AddItem("Base.AlcoholBandage") baginv:AddItem("Base.Antibiotics") end end if prof == "nimrod" then player:getInventory():AddItem("camping.CampingTentKit") player:getInventory():AddItem("Base.FlintKnife") local a = ZombRand(4) if a == 0 then player:getInventory():AddItem("Base.WoodenLance") end end if prof == "cook" then local a = ZombRand(4) if a == 0 then player:getInventory():AddItem("Base.MeatCleaver") else player:getInventory():AddItem("Base.KitchenKnife") end end if prof == "farmer" then player:getInventory():AddItem("farming.PotatoSeed") player:getInventory():AddItem("farming.PotatoSeed") player:getInventory():AddItem("farming.PotatoSeed") end if prof == "builder" then player:getInventory():AddItem("Base.Saw") player:getInventory():AddItem("Base.Hammer") player:getInventory():AddItem("Base.WoodenMallet") end if prof == "thief" then player:getInventory():AddItem("Base.HuntingKnife") player:getInventory():AddItem("Base.Screwdriver") end if prof == "scrapmech" then local a = ZombRand(4) player:getInventory():AddItem("Base.BlowTorch") if a == 0 then player:getInventory():AddItem("Base.PropaneTank") player:getInventory():AddItem("Base.WeldingRods") player:getInventory():AddItem("Base.WeldingMask") end end end end)
最後修改者:Tgraves710x; 2023 年 10 月 12 日 下午 3:08
< >
目前顯示第 1-10 則留言,共 10
Tgraves710x 2023 年 7 月 21 日 下午 2:25 
I'm gonna edit the code later to fix the way the items are, like scrap mechanic with a welding mask and etc.
wxdaz 2023 年 7 月 21 日 下午 11:39 
Is there a way where I can implement this into my own world?
Tgraves710x 2023 年 7 月 22 日 上午 3:58 
引用自 RustGamer211
Is there a way where I can implement this into my own world?
Yes there is, personally I implemented it into my world by going to the mods Lua folder/doc then using notepad to replace the code
Tgraves710x 2023 年 7 月 22 日 上午 8:26 
now the sharp shooter has a rifle and the medic some medical supplies, also gave the scrap mechanic a welding mask in their inventory if you choose not to have one when making your character. oh and the thief has a screwdriver.
最後修改者:Tgraves710x; 2023 年 7 月 22 日 上午 8:27
MacroPolo 2023 年 7 月 30 日 下午 3:23 
Where do you navigate to fix the items not spawning on characters? i'm having the same issue.
Tgraves710x 2023 年 7 月 30 日 下午 6:43 
引用自 MacroPolo
Where do you navigate to fix the items not spawning on characters? i'm having the same issue.
to implement this code you go in you files to
"C:\ProgramFiles(x86)\Steam\steamapps\workshop\content\108600\2856961307\mods\10YearslaterOccupationsSpawnItems\media\lua\client"
when you see "OccupationSpawnItems.lua" just open it with notepad once and replace the code there
最後修改者:Tgraves710x; 2023 年 7 月 30 日 下午 6:45
Scarlet Anh 2023 年 10 月 9 日 上午 11:48 
Is there a way to implement this in MP server?
Tgraves710x 2023 年 10 月 12 日 下午 3:11 
引用自 Scarlet Anh
Is there a way to implement this in MP server?
Yes you can, I forget how too since I haven't played in a while but I think it's to do with going into your servers folder mods
Hamburger Hinderer 2023 年 12 月 4 日 下午 4:45 
引用自 Tgraves710x
引用自 MacroPolo
Where do you navigate to fix the items not spawning on characters? i'm having the same issue.
to implement this code you go in you files to
"C:\ProgramFiles(x86)\Steam\steamapps\workshop\content\108600\2856961307\mods\10YearslaterOccupationsSpawnItems\media\lua\client"
when you see "OccupationSpawnItems.lua" just open it with notepad once and replace the code there

ABSOLUTE LIFE SAVER!
Tgraves710x 2023 年 12 月 12 日 上午 1:39 
引用自 Mr. Bubz (Redeemed)
引用自 Tgraves710x
to implement this code you go in you files to
"C:\ProgramFiles(x86)\Steam\steamapps\workshop\content\108600\2856961307\mods\10YearslaterOccupationsSpawnItems\media\lua\client"
when you see "OccupationSpawnItems.lua" just open it with notepad once and replace the code there

ABSOLUTE LIFE SAVER!
Ayyy! No problem, glad I could help!
< >
目前顯示第 1-10 則留言,共 10
每頁顯示: 1530 50