Skip to content

Commit

Permalink
Move voice chat check back to on_player_join, but schedule it (0.12.6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bavadin authored Jun 26, 2024
1 parent 7790c04 commit 7546b26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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
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

0 comments on commit 7546b26

Please sign in to comment.