|
| 02 May 2015 08:17 PM |
Why is this only changing one of them?
local Frames = script.Parent.Frames
for i, v in pairs(Frames:GetChildren()) do while true do v.SurfaceGui.Frame.BackgroundColor3 = Color3.new(math.random(), math.random(), math.random()) wait(1) end end |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 02 May 2015 08:21 PM |
local Frames = script.Parent.Frames
while true do for i, v in pairs(Frames:GetChildren()) do v.SurfaceGui.Frame.BackgroundColor3 = Color3.new(math.random(), math.random(), math.random()) wait(1) end end
--
Yours got the first frame, and put it in an infinite loop, so it never got to the next one. |
|
|
| Report Abuse |
|
|
|
| 02 May 2015 08:46 PM |
while true do for i, v in pairs(Frames:GetChildren()) do v.SurfaceGui.Frame.BackgroundColor3 = Color3.new(math.random(), math.random(), math.random()) end wait(1) end |
|
|
| Report Abuse |
|
|
|
| 02 May 2015 08:49 PM |
while true do for i, v in pairs(Frames:GetChildren()) do v.SurfaceGui.Frame.BackgroundColor3 = Color3.new(math.random(minimum number, maximum number)) end wait(1) end
you don't need 3 math.randoms and you need to add the minimum number it will choose and the max. |
|
|
| Report Abuse |
|
|
|
| 02 May 2015 09:41 PM |
"you don't need 3 math.randoms" Wrong. Color3.new takes three arguments.
"and you need to add the minimum number it will choose and the max." Wrong. Read the wiki, both arguments are optional - you can use 0, 1, or 2 arguments. It even works if you use 10 arguments I'm sure. |
|
|
| Report Abuse |
|
|
|
| 02 May 2015 09:43 PM |
Jarod, when I used this, Nothing happened:
for i, x in pairs(game.Workspace:WaitForChild("FloorLights"):GetChildren()) do local SurfaceGui= x:FindFirstChild("SurfaceGui") local FrameHolder = SurfaceGui:FindFirstChild("FrameHolder") if SurfaceGui and FrameHolder then while true do FrameHolder.BackgroundColor3 = Color3.new(math.random(), math.random(), math.random()) wait(1) end end end
And when I used the one Amanda fixed, it lit up the colors on all of them, yes, but did they change? No. |
|
|
| Report Abuse |
|
|
|
| 02 May 2015 09:47 PM |
| Well, what I mean is, it changes it again from the beginning. |
|
|
| Report Abuse |
|
|