1 | while wait(. 1 ) do |
2 | local RPart = Instance.new( "Part" , game.Workspace) |
3 | RPart.BottomSurface = "Smooth" |
4 | RPart.TopSurface = "Smooth" |
5 | RPart.BrickColor = BrickColor.new(Color 3. new(math.random( 255 ), math.random( 255 ), math.random( 255 ))) |
6 | end |
I was wondering how to make the color random, I was also wondering how to make each part fly out in different directions, and get destroyed after 3 seconds. Can someone help me with that? Thanks!
Just use Brick.Random()
. This would make a random color from the 64 available colors.
1 | while wait(. 1 ) do |
2 | local RPart = Instance.new( "Part" , game.Workspace) |
3 | RPart.BottomSurface = "Smooth" |
4 | RPart.TopSurface = "Smooth" |
5 | RPart.BrickColor = BrickColor.Random() |
6 | end |
Hope it helps!
01 | function PartColor() |
02 | game.Workspace.RPart.BrickColor = BrickColor.random() |
03 | end |
04 | wait(. 5 ) |
05 | PartColor() |
06 |
07 | wait( 10 ) -- You can remove this if you like |
08 |
09 | while true do |
10 | wait( 1 ) |
11 | game.Workspace.RPart.Position = 1.8 , 0.5 , 13.6 |
12 | wait( 1 ) |
13 | game.Workspace.RPart.Position = - 34.3 , 5.3 , - 9.5 |
14 | wait( 1 ) |
15 | game.Workspace.RPart.Position = 13.4 , 8.1 , 28.8 |
16 | wait(. 5 ) |
17 | game.Workspace.RPart:Destroy() |
18 | end |
I tried my best, Hope it helps!