How can I make the bricks change colour?
And how can I add music to only that place?(People should not hear it any where else apart from the disco)
How can I make the bricks change colour?
And how can I add music to only that place?(People should not hear it any where else apart from the disco)
Well, to make parts change color then you'd need to use a loop to change the part's color constantly.
Example:
while wait(1) do
part.BrickColor = BrickColor.new("Really red")
wait(1)
part.BrickColor = BrickColor.new("Bright green")
wait(1)
part.BrickColor = BrickColor.new("New yeller")
end
But, an even better way to do this would be using BrickColor.random() in a loop. BrickColor.random() will return a random color from the BrickColor scale so then you wouldn't have to write out all those colors.
Example:
while wait(1) do
part.BrickColor = BrickColor.random()
end
As for the sounds? You could just put an audio object inside of a part inside the disco area, then play that audio. The music would fade away as you walked away from the 'speaker'(part with audio in it).
Hope I Helped
+1
I'll give you the bit for the bricks... Not sure about the sounds though... Put this code into a script into the blocks that you want to change colour.
while true do
script.Parent.Color = Color3.new(math.random(), math.random(), math.random())
wait(0.5)
end
If this helps, Make sure you up vote my post :)
It looks better if you make it wait(0.5), instead of 1 second. while wait(0.5) do part.BrickColor = BrickColor.random() end
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
This post is not necessarily requesting for you to write code, it is simply asking how he would achieve his goals.
BasePart Instances use the BrickColor scale for their BrickColor(go figure:P), not the Color3 scale. Also, even if BasePart Instances took the Color3 scale.. the Color3 scale takes 3 arguments, each a number out of 255. So your script would only return black or white :P
I tested this and it flashed all different colours for me o.O
That's because the math.random() function without any arguments will be in percentile mode, meaning it will return a float/double between 0 and 1, rather than an integer.