Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help me with this please(Color, Instance.new and Direction)?

Asked by 9 years ago
1while wait(.1) do
2    local RPart = Instance.new("Part", game.Workspace)
3    RPart.BottomSurface = "Smooth"
4    RPart.TopSurface = "Smooth"
5    RPart.BrickColor = BrickColor.new(Color3.new(math.random(255), math.random(255), math.random(255)))
6end

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!

2 answers

Log in to vote
0
Answered by 9 years ago

Just use Brick.Random(). This would make a random color from the 64 available colors.


Final Product

1while wait(.1) do
2    local RPart = Instance.new("Part", game.Workspace)
3    RPart.BottomSurface = "Smooth"
4    RPart.TopSurface = "Smooth"
5    RPart.BrickColor = BrickColor.Random()
6end

Hope it helps!

Ad
Log in to vote
0
Answered by 9 years ago
01function PartColor()
02       game.Workspace.RPart.BrickColor = BrickColor.random()
03end
04wait(.5)
05PartColor()
06 
07wait(10) -- You can remove this if you like
08 
09while true do
10wait(1)
11game.Workspace.RPart.Position = 1.8, 0.5, 13.6
12wait(1)
13game.Workspace.RPart.Position = -34.3, 5.3, -9.5
14wait(1)
15game.Workspace.RPart.Position = 13.4, 8.1, 28.8
16wait(.5)
17game.Workspace.RPart:Destroy()
18end

I tried my best, Hope it helps!

Answer this question