How can I set an attribute of several objects at once? [solved]
semtex
25 Oct 2021, 20:53Just for some context: I already know how to generate a list of the objects, which I wish to change the attribute of. I use the following: <foreach (, FilterByType(ScopeVisible(), "Enemy")) { Do something,}>
I simple am unsure about how to do the something to each item in the list.
Any help would be greatly appreciated.
Edit: Sorry people, I finally managed to wrap my head around it.
mrangel
25 Oct 2021, 21:48I simple am unsure about how to do the something to each item in the list.
Just like you said. If you want to set some attribute to the same value for each item, you'd do
foreach (enemy, FilterByType(ScopeVisible(), "Enemy")) {
enemy.someattribute = "value"
}