Issue with check

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

alivdb

Member
Jan 12, 2018
1
0
0
Hi i made a server an role playing one, i want people to sit on a throne for a certain amount of time, after they've done that they gain access to the city. The problem is that i want that when the player leaves the throne the timer which goes from 300 second to 0 gets a reset otherwise they can just walk away, this is how i did it:

code_language.skript:
command /claim [<text>] [<text>]:
    trigger:
        if arg 1 is "list":
            message "&6&lClaim list:"
            message "&eKattegat"
            message "&eAkeota"
            message "&evillagehiddeninthesand"
            message "&eKonoha"
            message "&eBajah"
            message "&eHillyork"
            message "&eLakefortress"
            message "&eDragonstone"
        if arg 1 is "Kattegat":
            if {%arg-2%.%player%} is not set:
                message "Je zit niet in dat kingom"
                stop
            if {%arg-2%.%player%} is false:
                message "Je zit niet in dat kingom"
                stop
            if {%arg-2%.%player%} is true:
                {war} is 0:
                    message "&7[&4WAR&7] &4Er is geen oorlog bezig op het moment."
                {war} is 1:
                    if distance between the player and the location (787, 75, 143) is less than 1:
                        if {kattegat.%player%.claim} is not set:
                            set {kattegat.%player%.claim} to now
                        if {kattegat.%player%.claim} is 0:
                            set {kattegat.%player%.claim} to now
                        set {_waited} to difference between {kattegat.%player%.claim} and now
                        if {_waited} is less than {@kattegat}:
                        message "&7[&4War&7] &4Je moet nog %difference between 900 seconds and {_waited}% seconden wachten voordat je de troon hebt geclaimed!"
                        if {_waited} is more than {@kattegat}:
                            message "{@claimed}"
                            if {%arg-2%.%player%} is true:
                                execute command "/k region define %arg-2% kattegat"
                            if {%arg-2%.%player%} is not set:
                                message "Je zit niet in dat kingom"
                            set {kattegat.%player%.claim} to now
                            set {kattegat.%player%} to true
                       
                        wait 5 seconds
                        if distance between the player and the location (787, 75, 143) is more than 1:
                            message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                            set {kattegat.%player%.claim} to 0
                            wait 5 seconds
                            if distance between the player and the location (787, 75, 143) is more than 1:
                                message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                set {kattegat.%player%.claim} to 0
                                if distance between the player and the location (787, 75, 143) is more than 1:
                                    message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                    set {kattegat.%player%.claim} to 0
                                    wait 5 seconds   
                                    if distance between the player and the location (787, 75, 143) is more than 1:
                                        message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                        set {kattegat.%player%.claim} to 0
                                        wait 5 seconds
                                        if distance between the player and the location (787, 75, 143) is more than 1:
                                            message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                            set {kattegat.%player%.claim} to 0
                                            wait 5 seconds
                                            if distance between the player and the location (787, 75, 143) is more than 1:
                                                message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                set {kattegat.%player%.claim} to 0
                                                if distance between the player and the location (787, 75, 143) is more than 1:
                                                    message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                    set {kattegat.%player%.claim} to 0
                                                    wait 5 seconds   
                                                    if distance between the player and the location (787, 75, 143) is more than 1:
                                                        message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                        set {kattegat.%player%.claim} to 0
                                                        wait 5 seconds
                                                        if distance between the player and the location (787, 75, 143) is more than 1:
                                                            message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                            set {kattegat.%player%.claim} to 0
                                                            wait 5 seconds
                                                            if distance between the player and the location (787, 75, 143) is more than 1:
                                                                message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                set {kattegat.%player%.claim} to 0
                                                                if distance between the player and the location (787, 75, 143) is more than 1:
                                                                    message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                    set {kattegat.%player%.claim} to 0
                                                                    wait 5 seconds   
                                                                    if distance between the player and the location (787, 75, 143) is more than 1:
                                                                        message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                        set {kattegat.%player%.claim} to 0
                                                                        wait 5 seconds
                                                                        if distance between the player and the location (787, 75, 143) is more than 1:
                                                                            message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                            set {kattegat.%player%.claim} to 0
                                                                            wait 5 seconds
                                                                            if distance between the player and the location (787, 75, 143) is more than 1:
                                                                                message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                                set {kattegat.%player%.claim} to 0
                                                                                if distance between the player and the location (787, 75, 143) is more than 1:
                                                                                    message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                                    set {kattegat.%player%.claim} to 0
                                                                                    wait 5 seconds   
                                                                                    if distance between the player and the location (787, 75, 143) is more than 1:
                                                                                        message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                                        set {kattegat.%player%.claim} to 0
                                                                                        wait 5 seconds
                                                                                        if distance between the player and the location (787, 75, 143) is more than 1:
                                                                                            message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                                            set {kattegat.%player%.claim} to 0
                                                                                            wait 5 seconds
                                                                                            if distance between the player and the location (787, 75, 143) is more than 1:
                                                                                                message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                                                set {kattegat.%player%.claim} to 0
                                                                                                if distance between the player and the location (787, 75, 143) is more than 1:
                                                                                                    message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                                                    set {kattegat.%player%.claim} to 0
                                                                                                    wait 5 seconds   
                                                                                                    if distance between the player and the location (787, 75, 143) is more than 1:
                                                                                                        message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                                                                                                        set {kattegat.%player%.claim} to 0
                                                                                                        wait 5 seconds

Is there an easier way to do this?
 
1. Please use the List variables. its helpful for you sometimes.

2. Uhm, do loop?

(No clue what does this mean
  1. message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
so i hope this is right:emoji_slight_smile:

code_language.skript:
command /claim [<text>] [<text>]:
    trigger:
        if arg 1 is "list":
            message "&6&lClaim list:"
            message "&eKattegat"
            message "&eAkeota"
            message "&evillagehiddeninthesand"
            message "&eKonoha"
            message "&eBajah"
            message "&eHillyork"
            message "&eLakefortress"
            message "&eDragonstone"
        if arg 1 is "Kattegat" or "Akeota" or "villagehiddeninthesand" or "Konoha" or "Bajah" or "Hillyork" or "Lakefortress" or "Dragonstone":
            if {Claim::%player%::%arg-2%} is not set:
                message "Je zit niet in dat kingom"#You don'T need anymore "STOP" if you using "Else"
            else if {Claim::%player%::%arg-2%} is false:
                message "Je zit niet in dat kingom"
            else if {Claim::%player%::%arg-2%} is true:
                if {war} is 0:
                    message "&7[&4WAR&7] &4Er is geen oorlog bezig op het moment."
                else if {war} is 1:
                    if distance between the player and the location (787, 75, 143) is less than 1:
                        if {kattegat.%player%.claim} is not set:
                            set {kattegat.%player%.claim} to now
                        if {kattegat.%player%.claim} is 0:
                            set {kattegat.%player%.claim} to now
                        set {_waited} to difference between {kattegat.%player%.claim} and now
                        if {_waited} is less than {@kattegat}:
                        message "&7[&4War&7] &4Je moet nog %difference between 900 seconds and {_waited}% seconden wachten voordat je de troon hebt geclaimed!"
                        if {_waited} is more than {@kattegat}:
                            message "{@claimed}"
                            if {%arg-2%.%player%} is true:
                                execute command "/k region define %arg-2% kattegat"
                            if {%arg-2%.%player%} is not set:
                                message "Je zit niet in dat kingom"
                            set {kattegat.%player%.claim} to now
                            set {kattegat.%player%} to true
                        while distance between player and the location (787, 75, 143) is more than 1:
                            message "&7[&4WAR&7] &4Je moet op de troon zitten om te claimen!"
                            set {kattegat.%player%.claim} to 0
                            wait 5 seconds


#edit,

Forget to edit the rest Variables to list variables... Well... Your choosie. Using List Variables or use what you ever did.
 
Status
Not open for further replies.