I want to make it so when I click on a GUI, you can toggle the "Enabled" Value on every Part in the Model's PointLight, so basically you can Turn off and on every single light in the Model.
The layout is Model>Part>PointLight
script.Parent.MouseButton1Click:connect(function() local children = game.Workspace.Lights:GetChildren() for i = 1, #children do if i, children[i].PointLight.Enabled = true then i, children[i].PointLight.Enabled = false else i, children[i].PointLight.Enabled = true end end)
In every one of the i, children[i]
, just remove the i,
and you're good to go.
So in other words, i, children[i]
should look like children[i]
in all the lines.