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

How do you make a light flash when a button is pushed?

Asked by 4 years ago

When a brick/part is clicked, how do you make other lights flash for a certain amount of time?

0
not request site Brandon1881 721 — 4y
0
So many people are doing this today. Cynical_Innovation 595 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You can place a Script like this under the part. Please read the comments though and try to understand how this works by doing more research. This is a website that will only HELP you.

script.Parent.MouseButton1Click:Connect(function()
    for i = 1, 10 do -- second number will indicate how many times you want this to occur so it doesn't have to be 10
    local lights = game.Lighting:GetChildren() -- I'm just assuming that your lights are in Lighting
        if lights.Enabled = false then
            lights.Enabled = true
            wait(0.5) -- however many seconds you want the lights to stay on and it can be a decimal too. If you want flashing lights, then i suggest going for around 0.5
            lights.Enabled = false
        end
    end
end)
Ad

Answer this question