Hello, I think this should fix the issue of them not working simultaneously:
local Glass = workspace.SGGlassWindows:GetChildren()
local Turn = true
function Click()
coroutine.wrap(function()
for _,x in pairs(Glass) do
if x.Name == "Glass" and x:IsA("Part") then
if Turn == true then
x.Transparency= 0.65
wait()
x.Transparency= 0.1
wait()
x.Transparency= 0
else
x.Transparency= 0
wait()
x.Transparency= 0.1
wait()
x.Transparency= 0.65
end
end
end
end)()
if Turn == true then
Turn = false
script.Parent.Color = Color3.fromRGB(105,255,105)
wait(0.1)
script.Parent.Color = Color3.fromRGB(132, 140, 55)
wait(0.1)
script.Parent.Color = Color3.fromRGB(140, 54, 54)
else
Turn = true
script.Parent.Color = Color3.fromRGB(140, 54, 54)
wait(0.1)
script.Parent.Color = Color3.fromRGB(132, 140, 55)
wait(0.1)
script.Parent.Color = Color3.fromRGB(105,255,105)
end
end
script.Parent.ClickDetector.MouseClick:connect(Click)
I would also highly suggest using TweenService for transitioning between the transparency and color. It would give the transitions an better effect and help shorten your code.