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:
Is there an easier way to do this?
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?