YuriIsOffline Posted March 27, 2022 Share Posted March 27, 2022 Hi, so I'm creating a mod that has a custom weapon but I'm having a little problem coding the durability, I can't find how to code it, any help would be appreciated Link to comment https://forums.kleientertainment.com/forums/topic/138676-durability-problem/ Share on other sites More sharing options...
Bumber64 Posted March 27, 2022 Share Posted March 27, 2022 (edited) From prefabs/spear.lua: inst:AddComponent("finiteuses") inst.components.finiteuses:SetMaxUses(TUNING.SPEAR_USES) inst.components.finiteuses:SetUses(TUNING.SPEAR_USES) inst.components.finiteuses:SetOnFinished(inst.Remove) Edited March 27, 2022 by Bumber64 1 Link to comment https://forums.kleientertainment.com/forums/topic/138676-durability-problem/#findComment-1552986 Share on other sites More sharing options...
YuriIsOffline Posted March 27, 2022 Author Share Posted March 27, 2022 It worked! Thank you so much! 1 Link to comment https://forums.kleientertainment.com/forums/topic/138676-durability-problem/#findComment-1553052 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