Skip to content

Commit

Permalink
DP | Add delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Nik0-0 committed Feb 27, 2024
1 parent 27b689b commit 9777f6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scoreboard players set ticks nn_spawn 20
$say $(bot_name) $(id) $(map)
$execute unless entity @e[tag=$(bot_name)] run scoreboard players set spawn nn_nextbot_spawn $(id)
$tp @e[tag=$(bot_name)_z,tag=!done] @e[tag=$(map),limit=1,sort=random]
$tag @e[tag=$(bot_name)_z,tag=!done] add done
schedule function nnb_spawnsystem:map_detect 30t
$tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random]
execute if score ticks nn_spawn <= 0 nn_lobby run function nnb_spawnsystem:map_detect
10 changes: 7 additions & 3 deletions nnb_spawnsystem/main.jmc
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,15 @@ function call_bots() {

// Universal spawn bot stuff
function setup_bots() {
scoreboard players set ticks nn_spawn 20;

$say "$(bot_name) $(id) $(map)";
$execute unless entity @e[tag=$(bot_name)] run scoreboard players set spawn nn_nextbot_spawn $(id);
$tp @e[tag=$(bot_name)_z,tag=!done] @e[tag=$(map),limit=1,sort=random];
$tag @e[tag=$(bot_name)_z,tag=!done] add done;
schedule function map_detect() 30t;
$tp @e[tag=$(bot_name)_z] @e[tag=$(map),limit=1,sort=random];

if (nn_spawn:ticks <= nn_lobby:0) {
map_detect();
}
}


Expand Down

0 comments on commit 9777f6b

Please sign in to comment.