Give item with custom uses

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

KroterPvP

Active Member
Apr 10, 2017
178
7
18
22
Hello, it's possible to give a player an used item, for example an item with 30 uses left?

I'm trying to recreate a gun system, and when the gun needs more ammo, it recharges and I want to use item durability to make the recharging animation more user-friendly.
 
Hello, it's possible to give a player an used item, for example an item with 30 uses left?

I'm trying to recreate a gun system, and when the gun needs more ammo, it recharges and I want to use item durability to make the recharging animation more user-friendly.
https://www.skunity.com/search?search=DurabilitY
So something like:
code_language.skript:
Set the data value of The event-entity to 30
 
But this is an expression only usable in "on item damage:"

code_language.skript:
#here THE part that Triggers THE shooting
Set {_name} To name of Player's tool
Replace Every "&cGun&8: &e" with "" in {_name}
Set {_name} To "%{_name%" parsed as a integer
If {_name} >= 1:
   Remove 1 from {_name}
   Set name of player's tool To "&cGun&8: &e%{_name}%"
   # here THE bullet part
Else:
   Message "&cGun is empty."
 
Status
Not open for further replies.