Variable question

  • 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 community!

    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.

iStopcontact

Member
Feb 18, 2017
115
2
18
I am working on my own minigame for my server network.
Now i have allot of kits made called by number "1/2/3 etc. untill kit 60)

But i want when they die they go 1 kit back, but now was my question.
Is it possible to do when player has a kit between 1/10 and he dies he goes back one kit.
But for example when he is between 11/20 he goes back 2/3 kits.
So for example the skript code:
code_language.skript:
command /ggdead [<player>]:
    trigger:
        if {gungame:level:%arg 1%} is between 1 and 10:
            remove 1 from {gungame:level:%arg 1%}
 
I am working on my own minigame for my server network.
Now i have allot of kits made called by number "1/2/3 etc. untill kit 60)

But i want when they die they go 1 kit back, but now was my question.
Is it possible to do when player has a kit between 1/10 and he dies he goes back one kit.
But for example when he is between 11/20 he goes back 2/3 kits.
So for example the skript code:
code_language.skript:
command /ggdead [<player>]:
    trigger:
        if {gungame:level:%arg 1%} is between 1 and 10:
            remove 1 from {gungame:level:%arg 1%}

If that doesn't work, you can try this (it's very messy, but should work)

code_language.skript:
command /ggdead [<player>]:
    trigger:
        if {gungame:level:%arg 1%} is > 0:
            if {gungame:level:%arg 1%} < 10:
                remove 1 from {gungame:level:%arg 1%}
            else if {gungame:level:%arg 1%} > 10:
                if {gungame:level:%arg 1%} < 20:
                    remove 2 from {gungame:level:%arg 1%}
                else if {gungame:level:%arg 1%} > 20:
                    if {gungame:level:%arg 1%} < 30:
                        remove 3 from {gungame:level:%arg 1%}
                    else if {gungame:level:%arg 1%} > 30:
                        if {gungame:level:%arg 1%} < 40:
                            remove 4 from {gungame:level:%arg 1%}
                        else if {gungame:level:%arg 1%} > 40:
                            if {gungame:level:%arg 1%} < 50:
                                remove 5 from {gungame:level:%arg 1%}
                            else:
                                remove 6 from {gungame:level:%arg 1%}
 
Status
Not open for further replies.