It’s a for loop. It iterates through each item in the array “brickColors.” Index is the location of each item within the array, and value is each item in the array.
So basically the code runs once for each item in the array.
Yeesh I did a bad job explaining such a simple concept. If you don’t understand, let me know and I’ll elaborate.
Yeah, I think that’s my fault. I’ll try breaking down how it works for you:
brickColors is a list of brickColors
the for loop runs a bit of code for each item in brickColors
here’s what the for loop does:
index is 1, value is BrickColor.Red()
Wait 2 seconds
set the baseplate’s BrickColor to value
value is BrickColor.Red(), so the baseplate’s BrickColor is set to BrickColor.Red()
index is 2, value is BrickColor.Blue()
Wait 2 seconds
set the baseplate’s BrickColor to value
value is BrickColor.Blue(), so the baseplate’s BrickColor is set to BrickColor.Blue()
There is a list with a bunch of colors. The “values” variable stores the color. The for loop goes through each item in the list and sets value to the corresponding color. Then the baseplate.BrickColor thing sets the baseplates color to the value in the list.
super confusing, i still barely understand it. data storage is so weird.
i have been coding all day and i think it is time to sleep. i learned a LOT of information today (90% will be gone by tomorrow i guarantee it) and im still not 100% sure on a few things (parameters are a bitch tbh) but i am glad i took today to do absolutely nothing but code. although, i really hope i actually learned something and didn’t just stare at a code pretending to understand it. im going to try going without a guide tomorrow to see how much information i kept retained.
i doubt i remember all of it, if anything ill probably remember how to store data and make parts dissapear. thats okay tho, im not trying to remember everything, just trying to make sense of it so it will be easier in the long run.
i am pretty proud of myself but also simultaneously pissed off at myself for feeling stupid.
tomorrow as well as the following 2 weeks im not going to be coding all day bc i have band camp, however i will still find time to post my progress.
(btw if anyone is wondering im using this as my guide: Learn Roblox)
It’s always great seeing someone else learn how to code, kudos to you and good luck! Due to irl reasons (moving) I haven’t been able to practice regularly a few weeks after i’ve made this post. Maybe i’ll get back to learning tmrr lol.
mk. ive been following this scripting practice plugin for awhile (Studio+ was in a post made by SavageWind) and i learned a few new things like Enums and Intvalues. im not going to post any videos for it tho bc i didnt create the models for it. i will post a guided script that i was working on though.
made more of this shop. at first i tried putting this script into a part that when touched would open the chat gui, but then decided to put a local script into the startergui that does the same thing. this way, a chat gui would not appear on everyone’s screen, just the individual.