enchanted with looting

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

GenFede

Member
Aug 27, 2020
1
0
1
20
Hi!
So, i was trying to make a variable for looting, but even if the held item is enchanted with looting 1 or 2, the variable is always 3.
I tried to fix that adding an "else" between every "if held item..", but it does the opposite: the variable is always one, even if the sword is enchanted with looting 2 or 3
Anyone got any idea on why this is happening? I tried to fix it myself, but this is my first time using skript and im not very used to it :emoji_grinning:



Code:
on player tool changing:
    if held item is enchanted with looting 1:
        set {looting.%player%} to 1
    if held item is enchanted with looting 2:
        set {looting.%player%} to 2
    if held item is enchanted with looting 2:
        set {looting.%player%} to 2
 
Try This.
Code:
command /startloop:
    trigger:
        while 1 is 1:
            loop all players:
                if player's tool is enchanted with looting 1:
                    set {looting.%player%} to 1
                else if player's tool is enchanted with looting 2:
                    set {looting.%player%} to 2
                else if player's tool is enchanted with looting 3:
                    set {looting.%player%} to 3
                else:
                    set {looting.%player%} to 0
 
  • Like
Reactions: GenFede
Status
Not open for further replies.