#(ctr) run a foreach / while for multiple players at the same time

15 messages · Page 1 of 1 (latest)

covert kiln
#

Hey, i would like to play an effect for multiple players but can't figure out how. It always runs one player after another instead of simultaneously. I've found the instantly argument but that doesn't seem to help either.

here's the part of the script: https://paste.denizenscript.com/View/105761

hushed ferryBOT
#

(ctr) run a foreach / while for multiple players at the same time

hushed ferryBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

silk blade
covert kiln
#

alrighty will try, thanks!

#

so foreach player run effect
and only give the task the effect?

silk blade
#
run_for_everyone:
  type: task
  script:
  # this will loop for every player
  - foreach <server.players> as:player:
    - run player_task def:<[player]>
player_task:
  type: task
  definitions: player
  script:
    - narrate "hello, <[player].name>!"
    - wait 2s
    - narrate "how are you?"```
short example, will start `player_task` instantly for every player, but every player also will see the first narrate, wait 2s, and then the last narrate
covert kiln
#

thanks!