Zerobillion Posted July 27, 2025 Share Posted July 27, 2025 Trying to modify a function in the torch prefab. AddPrefabPostInit("torch", function(self) print("I have spawned") local og_fueleffect = self.getskillfueleffectmodifier self.getskillfueleffectmodifier = function(self, skilltreeupdater) print("Initiating Pre-hook") local ret = og_fueleffect(self, skilltreeupdater) print("Activating Posthook") return ret end end) The first print happens everytime a torch is spawned in, but everything else doesn't work. The hook isn't printing to the console and no code I put in it ever gets run. Other working mods do the same thing, like this mod for Wilson. AddComponentPostInit("beard", function(Beard) local original_EnableGrowth = Beard.EnableGrowth Beard.EnableGrowth = function(self, enable) if self.inst.prefab == 'wilson' then ---- do nothing else original_EnableGrowth(self, enable) end end I don't see how what I'm doing is any different... Link to comment https://forums.kleientertainment.com/forums/topic/167258-hook-function-never-being-run/ 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