Jump to content

Recommended Posts

Ok. I don't know what exhausted items is.

So the first step would be to create your edible item. I suggest you to take example on mod like "waiter 101" ( https://steamcommunity.com/sharedfiles/filedetails/?id=381565292 )

This way you have a template to follow (modded items are a little different to game item, so it will be easier).

When your item is done, you probably have to use addprefabpostinit to add the item to the drop list of the structure you want.

 

Take a look here for some example, you'll see a prefabpostinit function here.

Hey.

local function OnEat(inst, food)
    if food.prefab == "redgem" 
    or food.prefab == "bluegem" 
        then
            inst.components.hunger:DoDelta(100)
            inst.components.health:DoDelta(50)
            end
        end

Will give you 100 hunger and 50 sanity for eating a redgem or a bluegem. Just edit it as you will :p

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...