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

Help, to make a disco?

Asked by 9 years ago

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)

3 answers

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

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

Ad
Log in to vote
0
Answered by
Uroxus 350 Moderation Voter
9 years ago

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 :)

0
This post is not necessarily requesting for you to write code, it is simply asking how he would achieve his goals. RaverKiller 668 — 9y
0
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 Goulstem 8144 — 9y
0
I tested this and it flashed all different colours for me o.O Uroxus 350 — 9y
0
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. Redbullusa 1580 — 9y
Log in to vote
-1
Answered by 9 years ago

It looks better if you make it wait(0.5), instead of 1 second. while wait(0.5) do part.BrickColor = BrickColor.random() end

Answer this question