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 8 years ago
while wait(.1) do
    local RPart = Instance.new("Part", game.Workspace)
    RPart.BottomSurface = "Smooth"
    RPart.TopSurface = "Smooth"
    RPart.BrickColor = BrickColor.new(Color3.new(math.random(255), math.random(255), math.random(255)))
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!

2 answers

Log in to vote
0
Answered by 8 years ago

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


Final Product

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

Hope it helps!

Ad
Log in to vote
0
Answered by 8 years ago
function PartColor()
       game.Workspace.RPart.BrickColor = BrickColor.random()
end
wait(.5)
PartColor()

wait(10) -- You can remove this if you like

while true do
wait(1)
game.Workspace.RPart.Position = 1.8, 0.5, 13.6
wait(1)
game.Workspace.RPart.Position = -34.3, 5.3, -9.5
wait(1)
game.Workspace.RPart.Position = 13.4, 8.1, 28.8
wait(.5)
game.Workspace.RPart:Destroy()
end

I tried my best, Hope it helps!

Answer this question