Jump to content

[Solved] Way to make function can be used by all prefabs?


Recommended Posts

Hello, so I see in most structures they have stuff like

MakeLargeBurnable(inst)

which is a function from somewhere which can be applied to any prefab.

 

I'd like to know if that would be possible to do something like that? Like for example I have

local function Lower_All_Stats(inst, data)
	inst.components.hunger:DoDelta(-10)
	inst.components.health:DoDelta(-10)
	inst.components.sanity:DoDelta(-10)
end

would there be a way I can put this function somewhere in my mod then I can use " Lower_All_Stats(inst, data) " for any of my prefabs instead of copy pasting it into each prefab which wants to use it?

Thanks for reading:wilson_smile:!

Edited by SuperDavid
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...