Hey everyone, I couldn’t find any other forum topics relating to this so here we go.
I wish to have multiple lights change at once with a client sided script using ipairs, (the Script in question is not a LocalScript, it is a regular Script with the RunContext on Client). However, I can’t seem to get ipairs to work on the Client, only the Server.
Here is the code, my friend had tried to teach me how to use ipairs himself and I kinda get it.
Why are you using task.defer here? There’s no real benefit or performance increase because of how quickly that code will execute. Try printing each v value every iteration, could be that the parts didn’t load before the script run (that happens with LocalScripts, not sure with Scripts with RunContext set to Client because they are a child to the instance).
The issue is not to do with your use of ipairs. All ipairs does is return an iterator and the table.
This seems to have worked. I disabled the script and put a delay that would enable the script after 5 seconds, (when everything should be properly loaded in). All the lights did indeed change how I wished them to.