justjasper Posted March 8, 2018 Share Posted March 8, 2018 (edited) Thought this would be as simple as adding finiteuses, but no luck. This is concerning adding a new razor item and adding durability to the old item (since there's no point making a "better" razor if the vanilla one is unbreakable). Using prefabpostinit for the razor, and defined within the prefab file for the new razor. Basically it shows durability (100%) but no amount of shaving beefalo lowers the durability on either item. Anyone point me to what I'm missing? modmain.lua goldenrazor.lua More Gold Tools (DST).rar Edited March 8, 2018 by justjasper Link to comment https://forums.kleientertainment.com/forums/topic/88435-adding-durability-to-razor-solved/ Share on other sites More sharing options...
Aquaterion Posted March 8, 2018 Share Posted March 8, 2018 something like this should work; (modmain) AddComponentPostInit("beard", function(self) local oldShave = self.Shave function self:Shave(who, withwhat) local result = oldShave(self, who, withwhat) if result and withwhat and withwhat.components.finiteuses then withwhat.components.finiteuses:Use(1) end return result end end) Link to comment https://forums.kleientertainment.com/forums/topic/88435-adding-durability-to-razor-solved/#findComment-1012447 Share on other sites More sharing options...
justjasper Posted March 8, 2018 Author Share Posted March 8, 2018 16 minutes ago, Aquaterion said: <snip> Thanks, worked a charm! Link to comment https://forums.kleientertainment.com/forums/topic/88435-adding-durability-to-razor-solved/#findComment-1012451 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