Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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!

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.