Hi,
I have built an event hall and have all working lights and sounds etc. What I want to know is how do I get my lights to flash in a RANDOM sequence. So like when you are at a concert and fast paced music is on you have all the flashing lights How do I get that into a script?
Here is the script were the lights just turn on and pressed, and when pressed again they turn off.
local P = script.Parent.Parent
local LP1 = P.SpotLight12.Light.SpotLight
local LP2 = P.SpotLight11.Light.SpotLight
local LP3 = P.SpotLight10.Light.SpotLight
local LP4 = P.SpotLight9.Light.SpotLight
local LP5 = P.SpotLight8.Light.SpotLight
local LP6 = P.SpotLight7.Light.SpotLight
local LP7 = P.SpotLight6.Light.SpotLight
local LP8 = P.SpotLight5.Light.SpotLight
local LP9 = P.SpotLight4.Light.SpotLight
local LP10 = P.SpotLight3.Light.SpotLight
local LP11 = P.SpotLight2.Light.SpotLight
local LP12 = P.SpotLight1.Light.SpotLight
lp = {LP1, LP2, LP3, LP4, LP5, LP6, LP7, LP8, LP9, LP10, LP11, LP12}
btn = script.Parent.ClickDetector
function onClick()
for i, v in pairs(lp) do
v.Enabled = not v.Enabled
end
end
btn.MouseClick:connect(onClick)
How would I turn this script so that the lights flash in a RANDOM sequence?
Thanks Kieran

3 comments
I put that into the script replacing the other one and it does not seem to work.
Thanks for that! Works great! :D
No prob, happy to help!