Project Zomboid

Project Zomboid

Spiffo's Workshop
Welcome to Spiffo's Workshop, the place to find Project Zomboid mods, maps, buildings, and other things to tinker with. For our Modding Policy, click the "Learn More" Button below.
Learn More
why does this not work???
local foodIDs = { "Base.Flour", <removed 100 food items just for the reddit post visibility here> "Base.WaterBleachBottle", "Base.WaterBottleFull", "Base.WaterPopBottle", "Base.SodaCan", "Base.PopBottle", "Base.WaterBottle", "Base.Pop2", "Base.Pop3", "Base.JuiceBox", "Base.Pop", "Base.Pop2", "Base.Pop3", "Base.PopBottle", "Base.Mugfull", "Base.ColdCuppa", "Base.BeerCan", "Base.BeerBottle", "Base.Wine", "Base.WineWaterFull", "Base.Wine2", } function adjustItems() print("Adjusting item weights...") -- Adjust weights for food items for _, itemID in ipairs(foodIDs) do local item = ScriptManager.instance:getItem(itemID) if item then item:DoParam("Weight = 0.01") print("Adjusted weight for food item:", itemID) else print("Food item not found:", itemID) end end print("Finished adjusting item weights.") end -- Register the function to the event Events.OnInitGlobalModData.Add(adjustItems)

so this is a Code i made with help of ChatGPT, it does reduce the weight of Food, but not the one of SodaCans or WaterBottles? they stii weigfht 0.3 to 2.0l does anyone know what might be the problem?
< >
Showing 1-2 of 2 comments
If on B42 it may be due to the fact that drinks aren't directly a food item, rather a container that holds a liquid. So maybe the container weighs 0.01 but the liquid adds weight to it.

Base.(Item)Full also seems to have been removed in B42, according to the pzwiki.

If not then you should ask around in one of the Zomboid Mod discords. There should be more eyes and people who can help there.

:spiffo:
Last edited by YTho321; 12 Mar @ 5:15am
Thanks, but i dont have a Phone to join these discords, maybe else has a clue how to reduce three liquid weight :)
< >
Showing 1-2 of 2 comments
Per page: 1530 50