#for each

15 messages · Page 1 of 1 (latest)

vague swallow
#

I'm trying to make it so everyone holsters a cube on their back. How would I do this? My initial thought was through a for each but can't get it to work

atomic ravine
#

You’d have to make a list of all the cubes though

#

And with an int variable go up by one every “loop” and use that as the element

vague swallow
atomic ravine
#

No use list get element

#

And every time the for each loops increase the element by one

vague swallow
jagged ridge
# atomic ravine

I can design a photo for you by making it in-game quickly, but, this is how I would do it

Make an event called "Everyone Holster Object", have one player send it to all

Have each object you want players to have have their own tag like "Object1"

Get the Local Players index in Get All Players using List Get First Index Of

Then, when the local player receivers the event "Everyone Holster Object", they will holster the object with the tag "Object" combined with their index in Get All Players coverterted to a string using To String (Example, Player 0 is holstered the object Object0)

This way Player 0 is holstered the object with the tag Object0, Player 1 is holstered the object with the tag Object1 and so on

#

@atomic ravine

#

This way you dont need to run a For Each loop, you can just have each player run their own system

lone vale
#

true i should give up

jagged ridge
#

instead of having one person run everything for everyone, have that one person send an event to everyone telling them what to do