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.

Solved Error Detecting Held Item Skript

Discussion in 'Skript' started by Chickenman, Aug 26, 2022.

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

    Chickenman New Member

    Joined:
    Jul 30, 2021
    Messages:
    5
    Likes Received:
    0
    Hi! I've been trying to create a mana skript for my server and I wanted an item to give you more mana. I created a command that did this, and it worked, but when I tried it with an item, it didn't. Here's my code:
    Code (Text):
    1. variables:
    2.     {max.%player%} = 20
    3.     {mana.%player%} = {max.%player%}
    4.  
    5. every 1 second:
    6.     loop all players:
    7.         if {mana.%loop-player%} != {max.%loop-player%}:
    8.             add 1 to {mana.%loop-player%}
    9.  
    10. every 2 ticks:
    11.     loop all players:
    12.         if loop-player is holding a stick in off-hand:
    13.             {max.%loop-player%} = 25
    14.         else:
    15.             {max.%loop-player%} = 20
    16.             if {mana.%loop-player%} > 20:
    17.                 {mana.%loop-player%} = 20
    18.         send action bar with text "&bMana: %{mana.%loop-player%}%/%{max.%loop-player%}%" to loop-player
    19.  
    20.  
    21.  
    All I would like to know is the off-hand syntax for when I loop players. Thanks in advance!
    --- Double Post Merged, Aug 26, 2022, Original Post Date: Aug 26, 2022 ---
    Nevermind, it was that the variable was set incorrectly.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...