Skip to content

Commit

Permalink
DP | Add check to one tick function
Browse files Browse the repository at this point in the history
  • Loading branch information
Nik0-0 committed Feb 28, 2024
1 parent 8ef0aa1 commit fd64c9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
function nnb_spawnsystem:root
execute store result score botscount ynn_spawn if entity @e[tpe=!player,tag=nextbot]
execute if score disable nn_spawn matches 0 run function nnb_spawnsystem:__private__/if_else/2
execute if score started nn_lobby matches 1 run function nnb_spawnsystem:timer_msec
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ execute store result storage nnb_spawnsystem:temp limit int 1 run scoreboard pla
execute store result storage nnb_spawnsystem:__storage__ switch_key int 1 run scoreboard players get spawn nn_spawn
function nnb_spawnsystem:__private__/switch_case/1/select with storage nnb_spawnsystem:__storage__
scoreboard players remove ticks nn_spawn 1
execute if score ticks nn_spawn matches ..9 store result score botscount nn_spawn if entity @e[type=!player,tag=nextbot] setup_bots() with storage nnb_spawnsystem:temp
execute if score ticks nn_spawn matches ..9 run function nnb_spawnsystem:setup_bots with storage nnb_spawnsystem:temp
5 changes: 3 additions & 2 deletions nnb_spawnsystem/main.jmc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Text.tellraw(@a, "Spawn System Loaded");
function __tick__() {
root();

// Count the bots
execute store result score botscount ynn_spawn run execute if entity @e[tpe=!player,tag=nextbot];


// Only run spawn system if its enabled
if (nn_spawn:disable = 0) {
Expand Down Expand Up @@ -234,8 +237,6 @@ function call_bots() {
// Call the universal spawn bot function
scoreboard players remove ticks nn_spawn 1;
if (nn_spawn:ticks < 10) {
// Count the bots
execute store result score botscount nn_spawn run execute if entity @e[type=!player,tag=nextbot]
setup_bots() with storage nnb_spawnsystem:temp;
}}

Expand Down

0 comments on commit fd64c9c

Please sign in to comment.