Tell me the resolution of the image like 20 pixels by 20 pixels then we can go from there and then make a color array for each cube.
I was able to fix it. Here is the end result. https://i.imgur.com/R9ol11P.png
This is what my program looks like. https://i.imgur.com/9THlkt3.png
You really should change it to a loop and just have an array for colors and pixel size x pixel size.
Yeah Iāll reprogram it later to do that.
Yeah. The issue here is an excess of local variables, not Instance.new. Thereās a 200 local variable limit if I recall correctly. A few optimisations have already been recommended above, so I wonāt repeat them.
Really? You have any more information on this?
Iāve been programming for almost 10 years now and Iāve never came across a 200 local variable limit. That being said. Iām not sure if I even reached 200 before.
I donāt quite have any information, but you can test for this yourself.
Spam this in your code around 41 or more times:
local a = 1
local a = 1
local a = 1
local a = 1
local a = 1
And you get:
Not quite the same error as the OP but I have a feeling like theyāre related. The original code absolutely abuses and hard codes a colossal amount of local variables.
The local variable limit is imposed by the Lua VM.
Whole discussion you can follow from some years ago: