diff --git a/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction index 4b74b5e4..2497112f 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_datapack_tick.mcfunction @@ -11,9 +11,6 @@ execute as @a[team=do2.players, scores={do2.run.has_died=1}] run function do2:ev # Check if player has respawned execute as @e[type=player,scores={do2.utility.deathCount=1..}] run function do2:events/on_player_respawned -# Give playsound tag according to player Voice Chat status -execute as @e[type=player] run function do2:voice_chat/set - # if all players running do2 dead, end game. execute if score $dungeon do2.run.active matches 2 if score $dungeon do2.run.player_deaths = $dungeon do2.run.players run function do2:events/on_game_end diff --git a/Brilliance Datapack/data/do2/functions/events/on_player_join.mcfunction b/Brilliance Datapack/data/do2/functions/events/on_player_join.mcfunction index e0424462..ec907df6 100644 --- a/Brilliance Datapack/data/do2/functions/events/on_player_join.mcfunction +++ b/Brilliance Datapack/data/do2/functions/events/on_player_join.mcfunction @@ -30,3 +30,6 @@ execute positioned -524 103 2167 if entity @s[distance=..10] at @s run tp @s ~ ~ # If game hasn't started. Swap the difficulty, to the user's last used difficulty. execute if score $dungeon do2.utility.onServer matches 1 unless score $dungeon do2.run.active matches 1.. as @p[tag=do2.received_shulker] run function do2:dungeon_setup/preset_difficulty + +# Give playsound tag according to player Voice Chat status +schedule function do2:voice_chat/set 1t \ No newline at end of file diff --git a/Brilliance Datapack/data/do2/functions/voice_chat/set.mcfunction b/Brilliance Datapack/data/do2/functions/voice_chat/set.mcfunction index 43cfb283..b221727f 100644 --- a/Brilliance Datapack/data/do2/functions/voice_chat/set.mcfunction +++ b/Brilliance Datapack/data/do2/functions/voice_chat/set.mcfunction @@ -1,4 +1,4 @@ -scoreboard players set @s do2.utility.voiceChat 0 -function do2:voice_chat/check -execute if score @s do2.utility.voiceChat matches 0 run tag @s add do2.tags.audio.enabled -execute unless score @s do2.utility.voiceChat matches 0 run tag @s remove do2.tags.audio.enabled \ No newline at end of file +execute as @a run scoreboard players set @s do2.utility.voiceChat 0 +execute as @a run function do2:voice_chat/check +execute as @a if score @s do2.utility.voiceChat matches 0 run tag @s add do2.tags.audio.enabled +execute as @a unless score @s do2.utility.voiceChat matches 0 run tag @s remove do2.tags.audio.enabled \ No newline at end of file