Jump to content

Changing stack size of individual items


Recommended Posts

local function stacksizesmall(inst)
	if inst.components.stackable then
		inst.components.stackable.maxsize = 20
		--set max size to 20
	end
end

AddPrefabPostInit("gunpowder", stacksizesmall)
--before world initialize, "stacksizesmall" is added to gunpowder

Add this to your modmain.lua.

Link to comment
Share on other sites

12 hours ago, Combustiblemon said:

local function stacksizesmall(inst)
	if inst.components.stackable then
		inst.components.stackable.maxsize = 20
		--set max size to 20
	end
end

AddPrefabPostInit("gunpowder", stacksizesmall)
--before world initialize, "stacksizesmall" is added to gunpowder

Add this to your modmain.lua.

Oh nice, that works fine. Thanks a lot :D

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...