. . . Posted January 21, 2018 Share Posted January 21, 2018 (edited) 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! Edited January 21, 2018 by SuperDavid Link to comment Share on other sites More sharing options...
IronHunter Posted January 21, 2018 Share Posted January 21, 2018 I remember I used a snippet of code in my modmain similar to your question by defining the function as function GLOBAL.Lower_All_Stats(inst,data) --insert function code end I hope that helps, Cheers, Iron_Hunter Link to comment Share on other sites More sharing options...
. . . Posted January 21, 2018 Author Share Posted January 21, 2018 Thank you so much it worked perfectly ! Now I can delete all those copy paste functions hahaha Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now