#Loop all players at the same time

1 messages · Page 1 of 1 (latest)

north gate
#

i'm having trouble making this ability for my smp, it's like every player around the main one is pulled towards the main one at the same time
and loop player is not at the same time :P

here's the code rn:

                if loop-entity is not player:
                    Push loop-entity upwards with velocity 1
                    set {_victim} to loop-entity
                    loop 7 times:
                        draw the shape of a line from player's Position to {_victim}'s Head:
                            set event-shape's particle to Happy Villager particle
                        push loop-entity towards player at speed 0.3
                        wait 2 ticks```
blazing night
#

need to have the wait outside the player loop

#

prob need to save all the players in a list

#
    loop {_players::*}
        draw particles
    wait```
north gate
#

totally not suree abt the add loop player thingy

#

but that's what u mean right?

blazing night
#

pretty much

north gate
#

oki ig ill try

blazing night
#

add loop-player to {_players} won't work, need to use {_players::*} so its an actual list

#

and you need to format my pseudocode to be actual working code

#

but that's the idea

north gate
#

i don't even know what that means

blazing night
#

think

#

you already have your original code

#

mine is just the idea of how its structured

north gate
#

k well ig thanks for the help :D

warm fulcrumBOT
tame mulch
#

Why would you add them to a list?

north gate
#

@blazing night so i did some work and ended up with this:

                if loop-entity is not player:
                    add loop-entity to {_players::*}
                    send "Added %loop-entity% to players: %{_players::*}%" to player #debug
            Push {_players::*} upwards with velocity 1
            loop 7 times:
                draw the shape of a line from player's Position to {_players::*}'s Head:
                    set event-shape's particle to Happy Villager particle
                loop {_players::*}:
                    push {_players::*} towards player's position at speed 0.3
                wait 2 ticks```

but only the first entity is pushed toward the player and the other ones are just going towards positive X
u got any idea why that's happening?
blazing night
#

you're gonna want to push loop-value-2

north gate
#

oooohhh

#

leemme try

#

HOLY GENIUS

#

TYSM

warm fulcrumBOT
# north gate TYSM

Consider increasing someone's reputation with </reputation increase:1458495875985969212> if you found them to be helpful!

north gate
#

LMAO

warm fulcrumBOT
#

You successfully increased @blazing night's reputation. They now have 13 skoints!

tame mulch
north gate
#

it works now and doesn't lag so ill just keep it like this :P

tame mulch
north gate
#

i want it all at the same time

tame mulch
#

But i personally prefer using filters
all players where [distance between player and input < 40]

night wadi
tame mulch