|
| 04 Jul 2015 08:53 PM |
while true do P = 0 for i, s in pairs(dance_floor:GetChildren()) do if (s.ClassName == "Frame") then local originalcolor = s.BackgroundColor3 local newcolor = color3(0,0,0) for i = 0,1,0.02 do s.BackgroundColor3 = tween_color(originalcolor,newcolor,i) s.BackgroundTransparency = 1/(1/i) run.RenderStepped:wait() end s.BackgroundColor3 = color3(0,0,0) s.BackgroundTransparency = 1 --s.BackgroundColor = BrickColor.Random() end end run.RenderStepped:wait() end
It's a surface GUI, and I want it to randomly pick colors and flash them/change their colors. |
|
|
| Report Abuse |
|
|
Veltamax
|
  |
| Joined: 06 May 2012 |
| Total Posts: 368 |
|
|
| 04 Jul 2015 08:57 PM |
Maybe you could try doing:
Color3.new(math.random(0,255), math.random(0,255), math.random(0,255)
if that doesn't work, I don't know if this works or not, but you could try using that commented section there with the BrickColor.Random(), and put s.BackgroundColor = BrickColor.Random().Color |
|
|
| Report Abuse |
|
|
|
| 04 Jul 2015 09:02 PM |
| I mean randomly pick the frames, because it goes in order right now. |
|
|
| Report Abuse |
|
|
Veltamax
|
  |
| Joined: 06 May 2012 |
| Total Posts: 368 |
|
|
| 04 Jul 2015 09:11 PM |
Try something like this:
local frames = {}
for i,v in pairs (SURFACEGUI:GetChildren()) do if v.Name == "Frame" then --determining if it is a frame, change to needs table.insert(frames, v) end end
local pickedframe = frames[math.random(1,#frames)] |
|
|
| Report Abuse |
|
|
ash877
|
  |
| Joined: 18 Feb 2008 |
| Total Posts: 5142 |
|
|
| 04 Jul 2015 09:21 PM |
local s=SURFACEGUI:GetChildren()
local rand=s[math.random(1,#s)] |
|
|
| Report Abuse |
|
|