Hello guys i am creating skywars Auto startup system and then it's starts it's always repeating itself
Code:
Server: 1.8
Skript: 2.2
Code:
code_language.skript:
every 2 seconds:
loop all players:
if {sw.arena.%{arena.%loop-player%}%.online} is true:
if {sw.arena.%{arena.%loop-player%}%.list} > 1:
set {sw.arena.%{arena.%loop-player%}%.starting.countdown} to true
else if {sw.arena.%{arena.%loop-player%}%.list} < 1:
set {sw.arena.%{arena.%loop-player%}%.starting.countdown} to false
else:
stop
every 17 seconds:
loop all players:
if {sw.arena.%{arena.%loop-player%}%.starting.countdown} is true:
if {sw.arena.%{arena.%loop-player%}%.online} is true:
set {sw.arena.%{arena.%loop-player%}%.starting} to true
clear {chestitems::*}
if {sw.arena.%{arena.%loop-player%}%.starting.countdown} is true:
send "{@prefix} %{arena.%loop-player%}% will start in 15 seconds" to {sw.arena.%{arena.%loop-player%}%.players::*}
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 15
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 14
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 13
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 12
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 11
wait a second
if {sw.arena.%{arena.%loop-player%}%.starting.countdown} is true:
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 10
play sound "ENTITY_EXPERIENCE_ORB_PICKUP" to {sw.arena.%{arena.%loop-player%}%.players::*} with volume 1 and pitch 2
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 9
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 8
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 7
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 6
wait a second
if {sw.arena.%{arena.%loop-player%}%.starting.countdown} is true:
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 5
play sound "ENTITY_EXPERIENCE_ORB_PICKUP" to {sw.arena.%{arena.%loop-player%}%.players::*} with volume 1 and pitch 2
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 4
play sound "UI_BUTTON_CLICK" to {sw.arena.%{arena.%loop-player%}%.players::*} with volume 1 and pitch 2
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 3
play sound "UI_BUTTON_CLICK" to {sw.arena.%{arena.%loop-player%}%.players::*} with volume 1 and pitch 2
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 2
play sound "UI_BUTTON_CLICK" to {sw.arena.%{arena.%loop-player%}%.players::*} with volume 1 and pitch 2
wait a second
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 1
play sound "UI_BUTTON_CLICK" to {sw.arena.%{arena.%loop-player%}%.players::*} with volume 1 and pitch 2
wait 3 ticks
if {sw.arena.%{arena.%loop-player%}%.starting.countdown} is true:
if {sw.hardmode.%{arena.%loop-player%}%} is true:
loop all blocks in radius 50 of {sw.arena.%{arena.%loop-player%}%.center}:
set {_chestpatern.mid} to a random integer between 1 and 4
if {_chestpatern.mid} is 1:
if loop-block is a chest:
clear loop-block's inventory
clear {list.p1::*}
loop {chestitems.p1.::*}:
add loop-value-3 to {list.p1::*}
wait 5 ticks
loop {list.p1::*}:
set {_slot} to a random number between 1 and 27
set slot {_slot} of loop-block to loop-value-3
remove loop-value-3 from {list.p1::*}
if {_chestpatern.mid} is 2:
if loop-block is a chest:
clear loop-block's inventory
clear {list.p2::*}
loop {chestitems.p2.::*}:
add loop-value-3 to {list.p2::*}
wait 5 ticks
loop {list.p2::*}:
set {_slot} to a random number between 1 and 27
set slot {_slot} of loop-block to loop-value-3
remove loop-value-3 from {list.p2::*}
if {_chestpatern.mid} is 3:
if loop-block is a chest:
clear loop-block's inventory
clear {list.p3::*}
loop {chestitems.p3.::*}:
add loop-value-3 to {list.p3::*}
wait 5 ticks
loop {list.p3::*}:
set {_slot} to a random number between 1 and 27
set slot {_slot} of loop-block to loop-value-3
remove loop-value-3 from {list.p3::*}
if {_chestpatern.mid} is 4:
if loop-block is a chest:
clear loop-block's inventory
clear {list.p4::*}
loop {chestitems.p4.::*}:
add loop-value-3 to {list.p4::*}
wait 5 ticks
loop {list.p4::*}:
set {_slot} to a random number between 1 and 27
set slot {_slot} of loop-block to loop-value-3
remove loop-value-3 from {list.p4::*}
loop all blocks in radius 25 of {sw.arena.%{arena.%loop-player%}%.center}:
set {_chestpatern.mid} to a random integer between 1 and 2
if {_chestpatern.mid} is 1:
if loop-block is a chest:
clear loop-block's inventory
clear {list.p5::*}
loop {chestitems.p5.::*}:
add loop-value-3 to {list.p5::*}
wait 5 ticks
loop {list.p5::*}:
set {_slot} to a random number between 1 and 27
set slot {_slot} of loop-block to loop-value-3
remove loop-value-3 from {list.p5::*}
if {_chestpatern.mid} is 2:
if loop-block is a chest:
clear loop-block's inventory
clear {list.p6::*}
loop {chestitems.p6.::*}:
add loop-value-3 to {list.p6::*}
wait 5 ticks
loop {list.p6::*}:
set {_slot} to a random number between 1 and 27
set slot {_slot} of loop-block to loop-value-3
remove loop-value-3 from {list.p6::*}
else:
set {sw.cantleave.%loop-player%} to true
set {sw.arena.%{arena.%loop-player%}%.players::*}'s level to 0
set blocks below {sw.arena.%{arena.%loop-player%}%.players::*} to air
clear {sw.arena.%{arena.%loop-player%}%.players::*}'s inventory
set {sw.arena.%{arena.%loop-player%}%.players::*}'s gamemode to survival
set {sw.arena.%{arena.%loop-player%}%.online} to false
loop {sw.arena.%{arena.%loop-player%}%.players::*}:
delete {damager.%loop-value-1%}
broadcast "{@prefix} Arena %{arena.%loop-player%}% has been started!"
delete {sw.arena.%{arena.%loop-player%}%.starting}
loop {sw.arena.%{arena.%loop-player%}%.players::*}:
if {sw.kit.Viking.%loop-value-1%} is true:
equip loop-value-1 with iron chestplate named "&eViking Chestplate"
set slot 1 of loop-value-1 to mushroom stew named "&cRegeneration soup"
set slot 0 of loop-value-1 to iron sword named "&eViking Sword"
set slot 2 of loop-value-1 to 10 of quartz block:0 named "&fIron Block"
if {sw.kit.Archer.%loop-value-1%} is true:
equip loop-value-1 with leather chestplate named "&eArcher Chestplate"
set slot 1 of loop-value-1 to mushroom stew named "&cRegeneration soup"
set slot 0 of loop-value-1 to bow named "&eArcher Bow"
set slot 2 of loop-value-1 to 20 of dirt
set slot 8 of loop-value-1 to 10 of arrow
if {sw.kit.Slime.%loop-value-1%} is true:
set {_slime} to "MHF_Slime" parsed as offline player
set {_slime} to "protection 1" parsed as enchantment
equip loop-value-1 with {_slime} named "&fSlime"
set {_slimeball} to slimeball
enchant {_slimeball} with knockback 2
set slot 0 of loop-value-1 to {_slimeball} named "&eSlime Hand"
set slot 1 of loop-value-1 to 10 of slime_block
if {sw.kit.RegSoup.%loop-value-1%} is true:
set slot 0 of loop-value-1 to mushroom stew named "&cRegeneration soup"
Server: 1.8
Skript: 2.2