Jump to content

Recommended Posts

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.

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)

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.

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!

image.png.3b6c386009cc5f5096c34400f62b9809.png

I adde d comments to where these should be put. Here:

actable.lua

  • Big Ups 1

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!

  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...