for _, child in pairs(workspace.Carlights:GetChildren()) do
if child.Name == "PointLight" then
child.Enabled = false
end
end
I get no errors, I want it to disable the pointlight in every part named "CarLights"
for _, child in pairs(workspace.Carlights:GetChildren()) do
if child.Name == "PointLight" then
child.Enabled = false
end
end
I get no errors, I want it to disable the pointlight in every part named "CarLights"
Try using ClassName. Fix: (i think)
for _, child in pairs(workspace.Carlights:GetChildren()) do
if child.ClassName == "PointLight" then
child.Enabled = false
end
end
You can simple use if child:IsA("PointLight") then
It still doesnt work
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
In every part named CarLights? Or in the "Carlights" part, and every part named "PointLight" you want to disable. That's what your code suggests. Check if child.Name == "CarLights", then index that child's PointLight and disable it.
I dont understand