Im trying to make a script that changes the color of all lights in game.
When I try and change the color of all the spotlights it just errors and says color is not a valid member of v?
for i,v in pairs (workspace.Lights:GetDescendants()) do
if v:IsA("SpotLight") and script.Parent.Activated.Value == true then
while true do
v.Color = Color3.fromRGB(255, 0, 0)
wait(1)
v.Color = Color3.fromRGB(255,255,255)
wait(1)
v.COlor = Color3.fromRGB(0,0,0)
end
elseif script.Parent.Activated.Value == false then
v.Color = Color3.fromRGB(255,255,255)
end
end
Alright, understandable. Anyways, you have some misspelling in your code. It says COlor is not a valid member of v because it thought it wasn’t the property, but instead a child.