DeadlyFox Posted May 12, 2025 Share Posted May 12, 2025 I have a custom item that can be used similary to wickerbottoms books but i dont know how to make them lose durability when used, if any one could help that would be great! Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/ Share on other sites More sharing options...
FurryEskimo Posted May 15, 2025 Share Posted May 15, 2025 I think you're looking for the finite uses component. You pretty much have to toss that in when making the coomon_fn, define its maximum and starting uses, and then when you use the item, tell it to use a certain number of the available durability. I believe you also need to add a function that defines what happened happens when it runs out of uses. I used this code a few times when making Wirra. Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/#findComment-1816039 Share on other sites More sharing options...
DeadlyFox Posted May 15, 2025 Author Share Posted May 15, 2025 I already have a finite uses component, but it only works when attacking something, and I want it to work when used as well. May it be because it has as tag '' weapon''? (also big fan of your mod, it is rly cool) Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/#findComment-1816065 Share on other sites More sharing options...
Baguettes Posted May 15, 2025 Share Posted May 15, 2025 41 minutes ago, DeadlyFox said: I already have a finite uses component, but it only works when attacking something, and I want it to work when used as well. May it be because it has as tag '' weapon''? (also big fan of your mod, it is rly cool) Used, you mean Right Click action? Hm. Again, this could probably be best looked into your item's component, the function that activates it. Remember your honk? Maybe add finiteuses:Use(useshere) to it. Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/#findComment-1816071 Share on other sites More sharing options...
DeadlyFox Posted May 19, 2025 Author Share Posted May 19, 2025 It gives me this error, tho I dont know how good the code that I put was. Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/#findComment-1816414 Share on other sites More sharing options...
Baguettes Posted May 21, 2025 Share Posted May 21, 2025 Hm. Send that file, I suppose. That's a wee bit too vague. Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/#findComment-1816586 Share on other sites More sharing options...
DeadlyFox Posted May 21, 2025 Author Share Posted May 21, 2025 oh okay, I am sorry for that. here is the file: actable.lua Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/#findComment-1816594 Share on other sites More sharing options...
Baguettes Posted May 26, 2025 Share Posted May 26, 2025 Ack. I forgot to reply to this... @DeadlyFox One thing though: Don't take the texts literally! You did `add finiteuses:Use(30)` to your code, but that's not what I meant! I adde d comments to where these should be put. Here: actable.lua 1 Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/#findComment-1817983 Share on other sites More sharing options...
DeadlyFox Posted May 27, 2025 Author Share Posted May 27, 2025 Oh okay ToT (I am still not that experienced with lua so my bad), thanks a lot for helping me again! also I am almost finished with the mod now, I just have to do some bug fixes and the trailer for it now, so i think it will be all good to go soon! 1 Link to comment https://forums.kleientertainment.com/forums/topic/165691-need-help-i-want-to-make-a-custom-item-lose-durability-when-used/#findComment-1818206 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