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

Changing colors Clicked?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

I need this script so it will keep changing colors for infinity and don't have to keep clicking on the button.

function Clicked()
    brick = game.Workspace
--Color part
brick.SurfacePart.Lights.LightPart1.BrickColor = BrickColor.random()
brick.SurfacePart.Lights.LightPart2.BrickColor = BrickColor.random()
brick.SurfacePart.Lights.LightPart3.BrickColor = BrickColor.random()
brick.SurfacePart.Lights.LightPart4.BrickColor = BrickColor.random()
wait(0.5)
brick.SurfacePart.Lights.LightPart1.PointLight.Color = Color3.random()
brick.SurfacePart.Lights.LightPart2.PointLight.Color = Color3.random()
brick.SurfacePart.Lights.LightPart3.PointLight.Color = Color3.random()
brick.SurfacePart.Lights.LightPart4.PointLight.Color = Color3.random()
end

script.Parent.MouseButton1Down:connect(Clicked)

3 answers

Log in to vote
0
Answered by 10 years ago
function Clicked()
    brick = game.Workspace
local var = 0
repeat
brick.SurfacePart.Lights.LightPart1.BrickColor = BrickColor.random()
brick.SurfacePart.Lights.LightPart2.BrickColor = BrickColor.random()
brick.SurfacePart.Lights.LightPart3.BrickColor = BrickColor.random()
brick.SurfacePart.Lights.LightPart4.BrickColor = BrickColor.random()
wait(0.5)
brick.SurfacePart.Lights.LightPart1.PointLight.Color = Color3.random()
brick.SurfacePart.Lights.LightPart2.PointLight.Color = Color3.random()
brick.SurfacePart.Lights.LightPart3.PointLight.Color = Color3.random()
brick.SurfacePart.Lights.LightPart4.PointLight.Color = Color3.random()
end
until var==10

script.Parent.MouseButton1Down:connect(Clicked)

People these days forgetting what "Repeat" is qq

0
Wrong. Doesn't work NotSoNorm 777 — 10y
0
Wait LOL I MISPLACED MY END XD RolandStudio 115 — 10y
0
Lel. NotSoNorm 777 — 10y
0
Just put the end Over the until RolandStudio 115 — 10y
View all comments (3 more)
0
Like this? "end var==10" NotSoNorm 777 — 10y
0
No Like after the line that Until is in RolandStudio 115 — 10y
0
Er, Its not repeating the random colors, You click on it and it changes colors only one time then breaks. NotSoNorm 777 — 10y
Ad
Log in to vote
0
Answered by
Xduel 211 Moderation Voter
10 years ago

function Clicked() while true do local brick = game.Workspace --Color part brick.SurfacePart.Lights.LightPart1.BrickColor = BrickColor.random() brick.SurfacePart.Lights.LightPart2.BrickColor = BrickColor.random() brick.SurfacePart.Lights.LightPart3.BrickColor = BrickColor.random() brick.SurfacePart.Lights.LightPart4.BrickColor = BrickColor.random() wait(0.5) brick.SurfacePart.Lights.LightPart1.PointLight.Color = Color3.random() brick.SurfacePart.Lights.LightPart2.PointLight.Color = Color3.random() brick.SurfacePart.Lights.LightPart3.PointLight.Color = Color3.random() brick.SurfacePart.Lights.LightPart4.PointLight.Color = Color3.random() end end

script.Parent.MouseButton1Down:connect(Clicked)

Log in to vote
0
Answered by 10 years ago
function Clicked()
    local brick = game.Workspace
    while true do
        brick.SurfacePart.Lights.LightPart1.BrickColor = BrickColor.Random()
        brick.SurfacePart.Lights.LightPart2.BrickColor = BrickColor.Random()
        brick.SurfacePart.Lights.LightPart3.BrickColor = BrickColor.Random()
        brick.SurfacePart.Lights.LightPart4.BrickColor = BrickColor.Random()
        wait(0.5)
        brick.SurfacePart.Lights.LightPart1.PointLight.Color = BrickColor.Random().Color
        brick.SurfacePart.Lights.LightPart2.PointLight.Color = BrickColor.Random().Color
        brick.SurfacePart.Lights.LightPart3.PointLight.Color = BrickColor.Random().Color
        brick.SurfacePart.Lights.LightPart4.PointLight.Color = BrickColor.Random().Color
    end
end

script.Parent.MouseButton1Down:connect(Clicked)

Answer this question