1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Give item with custom uses

Discussion in 'Skript' started by KroterPvP, Jul 17, 2017.

Thread Status:
Not open for further replies.
  1. KroterPvP

    KroterPvP Active Member

    Joined:
    Apr 10, 2017
    Messages:
    178
    Likes Received:
    7
    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.
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    https://www.skunity.com/search?search=DurabilitY
    So something like:
    Code (Skript):
    1. Set the data value of The event-entity to 30
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Code (Skript):
    1.  
    2.  
    3. #here THE part that Triggers THE shooting
    4. Set {_name} To name of Player's tool
    5. Replace Every "&cGun&8: &e" with "" in {_name}
    6. Set {_name} To "%{_name%" parsed as a integer
    7. If {_name} >= 1:
    8.    Remove 1 from {_name}
    9.    Set name of player's tool To "&cGun&8: &e%{_name}%"
    10.    # here THE bullet part
    11. Else:
    12.    Message "&cGun is empty."
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    I meant this one:
    https://www.skunity.com/search?search=Durabil
    --- Double Post Merged, Jul 17, 2017, Original Post Date: Jul 17, 2017 ---
    So for example:
    Code (Skript):
    1. On left click using wooden hoe:
    2.     Remove 1 from the data value of the player's tool
    That should work
     
Thread Status:
Not open for further replies.

Share This Page

Loading...