I’m having problems with my light system working
Type: Script
Errors: nil
local LightsOnValue = game.ReplicatedStorage.LightsOn
local Lights = game.Workspace.Lights
--// Functions
function ToggleLights()
for i,v in pairs(Lights:GetChildren()) do
if v:IsA("Part") and v.Parent:FindFirstChild("PointLight") then
v.Parent:FindFirstChild("PointLight").Enabled=game.ReplicatedStorage.LightsOn.Value
end
end
end
LightsOnValue.Changed:Connect(function()
print("Light Value Changed")
ToggleLights()
end)