I am not sure what this means exactly and I am trying to figure out how it works to understand it. I only don't understand for_, tp in pairs(taggedParts) do
local collectionService = game:GetService("CollectionService") local taggedParts = collectionService:GetTagged("steps") for _, tp in pairs(taggedParts) do local tile = tp local db = true
taggedParts
is a table containing all the tag parts.
The code you provided is a for loop that runs N
times. N being the number of items in your table. Each time it runs, it gets the next item in taggedParts, starting with the first item. tp
is the current part in the taggedParts list.
If you were to make the loop more 'english-like' it would mean:
for each tagged part in a list of tagged parts do whatever you want here. usually this is doing something to to the tagged part end
You usually use this type of loop when you have a list of items and you want to do something to each item or items in that list.