Hello Scripters :D , i have created a part that when u touch the switch you change the colour of 12 part in a folder and 12 parts in another folder ,so i use this this script:
Changer = script.Parent
local t=0
local f = 0
Changer.ClickDetector.MouseClick:Connect (function()
while true do
for _, Green in pairs(workspace.Game.Lobby.Structure.WindowFrame:GetChildren()) do
Green.BrickColor = BrickColor.new("Really red")
wait(f)
end
for _, Green in pairs(workspace.Game.Lobby.Structure.YellowMarks:GetChildren()) do
Green.BrickColor = BrickColor.new("Really red")
wait(f)
end
wait(t)
for _, Green in pairs(workspace.Game.Lobby.Structure.WindowFrame:GetChildren()) do
Green.BrickColor = BrickColor.new("Deep orange")
wait(f)
end
for _, Green in pairs(workspace.Game.Lobby.Structure.YellowMarks:GetChildren()) do
Green.BrickColor = BrickColor.new("Deep orange")
wait(f)
end ..................
the problem is, that when i click the switch, the parts change the colour,but not instantly... like all wait is set to 0,why it doesent do that instantly?

1 comment
your right, thanks.