I'm trying to put the name of parts in a table, then find those parts in the workspace.
My code:
lights = {"Light1"}
i = 1
repeat
game.Workspace.lights[i].PointLight.Brightness = game.Workspace.lights[i].PointLight.Brightness - .1
game.Workspace.lights[i].PointLight.Range = game.Workspace.lights[i].PointLight.Range - .1
if i == #lights then
i = 1
else
i = i + 1
end
until game.Workspace.lights[#lights].PointLight.Range == 0
This errors, "lights is not a valid member of Workspace". So how can I find a part using the name of it in a table?
