I know it must be due to an infinite loop, but I don't know how to fix it. The two only culprits I know it is.
while true do
script.Parent.Value.Value = 1
wait(10)
script.Parent.Value.Value = 2
wait(10)
script.Parent.Value.Value = 3
wait(10)
script.Parent.Value.Value = 4
wait(10)
script.Parent.Value.Value = 5
wait(10)
end
A = script.Parent.Blue:GetChildren()
B = script.Parent.Red:GetChildren()
change = 1
script.Parent.Value.Changed:connect(function()
print(change)
end)
while true do
if script.Parent.Value.Value == 1 then
change = 1
elseif script.Parent.Value.Value == 2 then
change = 0.75
elseif script.Parent.Value.Value == 3 then
change = 0.5
elseif script.Parent.Value.Value == 4 then
change = 0.25
elseif script.Parent.Value.Value == 5 then
change = 0.15
end
end
while true do
for i,v in pairs(A) do
v.PointLight.Enabled = true
v.SurfaceGui.TextLabel.BackgroundTransparency = 0
end
for i,v in pairs(B) do
v.PointLight.Enabled = false
v.SurfaceGui.TextLabel.BackgroundTransparency = 1
end
wait(change)
for i,v in pairs(A) do
v.PointLight.Enabled = false
v.SurfaceGui.TextLabel.BackgroundTransparency = 1
end
for i,v in pairs(B) do
v.PointLight.Enabled = true
v.SurfaceGui.TextLabel.BackgroundTransparency = 0
end
wait(change)
end

2 comments
I wouldn't suggest the latter method of using wait because in the slight chance that none of those conditions are true the loop will crash because no wait() commands will run. It's much simpler and cleaner to just put a wait at the end
True, i made a slight mistake, and yes the first option is the best one.