#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#Cooldown
scoreboard players add @s cooldown 1
execute at @s[scores={cooldown=2}] run playsound minecraft:entity.wither.shoot master @s ~ ~ ~ 1 2
execute at @s[scores={cooldown=2}] run playsound minecraft:block.note_block.bass master @s ~ ~ ~ 1 2
clear @s[scores={cooldown=2}] snowball
scoreboard players set @s[tag=machinegun,scores={cooldown=..17}] cooldown 18

playsound minecraft:block.note_block.hat master @s[scores={cooldown=1}] ~ ~ ~ 0.3 0.5
playsound minecraft:block.note_block.hat master @s[scores={cooldown=3}] ~ ~ ~ 0.3 0.7
playsound minecraft:block.note_block.hat master @s[scores={cooldown=5}] ~ ~ ~ 0.3 0.9
playsound minecraft:block.note_block.hat master @s[scores={cooldown=7}] ~ ~ ~ 0.3 1.1
playsound minecraft:block.note_block.hat master @s[scores={cooldown=9}] ~ ~ ~ 0.3 1.3
playsound minecraft:block.note_block.hat master @s[scores={cooldown=11}] ~ ~ ~ 0.3 1.5
playsound minecraft:block.note_block.hat master @s[scores={cooldown=13}] ~ ~ ~ 0.3 1.7
playsound minecraft:block.note_block.hat master @s[scores={cooldown=15}] ~ ~ ~ 0.3 1.9
playsound minecraft:block.note_block.harp master @s[scores={cooldown=17..20},tag=!machinegun] ~ ~ ~ 0.3 2
title @s[tag=!hold_compass,scores={cooldown=1..2}] actionbar ["",{"text":"▉▉▉▉▉▉▉▉▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=3..4}] actionbar ["",{"text":"▉","color":"green"},{"text":"▉▉▉▉▉▉▉▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=5..6}] actionbar ["",{"text":"▉▉","color":"green"},{"text":"▉▉▉▉▉▉▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=7..8}] actionbar ["",{"text":"▉▉▉","color":"green"},{"text":"▉▉▉▉▉▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=9..10}] actionbar ["",{"text":"▉▉▉▉","color":"green"},{"text":"▉▉▉▉▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=11..12}] actionbar ["",{"text":"▉▉▉▉▉","color":"green"},{"text":"▉▉▉▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=13..14}] actionbar ["",{"text":"▉▉▉▉▉▉","color":"green"},{"text":"▉▉▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=15..16}] actionbar ["",{"text":"▉▉▉▉▉▉▉","color":"green"},{"text":"▉▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=17..18},tag=!machinegun] actionbar ["",{"text":"▉▉▉▉▉▉▉","color":"green"},{"text":"▉","color":"#1ACF02"},{"text":"▉▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=19},tag=!machinegun] actionbar ["",{"text":"▉▉▉▉▉▉▉","color":"green"},{"text":"▉▉","color":"#1ACF02"},{"text":"▉","color":"gray"}]
title @s[tag=!hold_compass,scores={cooldown=20},tag=!machinegun] actionbar ["",{"text":"▉▉▉▉▉▉▉","color":"green"},{"text":"▉▉▉","color":"#1ACF02"}]
scoreboard players set @s[scores={cooldown=20..}] cooldown 0
