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 Script?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Can someone help me with this Script? Its pretty simple but Idk whats wrong with it. I want it to rapidly change the Brickcolor randomly. When I run it it changes it once.

lol= true

repeat
game.Workspace.Part.Color= Color3.new  (math.random)
wait()
game.Workspace.Part.Color= Color3.new  (math.random)
wait()
until lol == false

1 answer

Log in to vote
1
Answered by 10 years ago

Well, if you wanted to change the color randomly, you would do this:

while true do
    game.Workspace.Part.Color= Color3.new(math.random,math.random,math.random)
    wait()
    game.Workspace.Part.Color= Color3.new(math.random,math.random,math.random)
    wait()
end

Because Color3 requires 3 values, Red, Green, and Blue. Like this: Color3.new(R,G,B). But if you wanted to change the BrickColor randomly, you would do this:

while true do
    game.Workspace.Part.BrickColor= BrickColor.Random()
    wait()
    game.Workspace.Part.BrickColor= BrickColor.Random()
    wait()
end

Hope this helped!

*Note: The R, G, and B values in a Color3 range from 0 - 1. 1 being the brightest of that value, and 0 being the darkest of that value. For example, Color3.new(1,0,0) is completely red.

0
Thanks :D but just a question whats the Difference between the Color and the BrickColor? tempodoa 0 — 10y
0
BrickColor is the list of colors you get when you change the color of a brick manually. Color is the mixture of Red, Green, and Blue TurboFusion 1821 — 10y
Ad

Answer this question