Solved Error Detecting Held Item Skript

  • 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.

Chickenman

Member
Jul 30, 2021
10
0
1
34
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:
variables:
    {max.%player%} = 20
    {mana.%player%} = {max.%player%}

every 1 second:
    loop all players:
        if {mana.%loop-player%} != {max.%loop-player%}:
            add 1 to {mana.%loop-player%}

every 2 ticks:
    loop all players:
        if loop-player is holding a stick in off-hand:
            {max.%loop-player%} = 25
        else:
            {max.%loop-player%} = 20
            if {mana.%loop-player%} > 20:
                {mana.%loop-player%} = 20
        send action bar with text "&bMana: %{mana.%loop-player%}%/%{max.%loop-player%}%" to loop-player

All I would like to know is the off-hand syntax for when I loop players. Thanks in advance!
[doublepost=1661553690,1661549981][/doublepost]Nevermind, it was that the variable was set incorrectly.
 
Status
Not open for further replies.