Help with arrays

How can i add few in-world texts without creating variables to each one, can i add all of them to a single array and then delete all texts at once?

I guess you mean variables for the IDs?

Yes you can:

global.IDs = empty array
create text(...)
modify global variable(IDs, append to array, last text id)
create text(...)
modify global variable(IDs, append to array, last text id)
create text(...)
modify global variable(IDs, append to array, last text id)
create text(...)
modify global variable(IDs, append to array, last text id)
...

Yes, but not with a single action:

for global variable(loopCounter, 0, count of(global.IDs), 1)
destroy inworld text(global.IDs[global.loopCounter])
end
global.IDs = empty array

This: global.IDs[global.loopCounter]
looks like this when created in workshop: value in array(global variable(IDs), global variable(loopCounter))

1 Like

Thank you, i never knew how to use arrays.

1 Like