|
| 13 Aug 2013 07:50 PM |
| How do i make like a polic lightbar that keeps flashing? Im new to scripting. |
|
|
| Report Abuse |
|
|
| |
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 13 Aug 2013 07:54 PM |
Oh, POLICE light bar. Dang I was confused. Anyways, have a model with the two parts you want to flash named 'Red' and 'Blue'. Then, insert a PointLight into both and color it appropriately. Insert this script into the model:
local intervals = 0.5 -- change to seconds between flashing local red,blue = script.Parent.Red.PointLight,script.Parent.Blue.PointLight function alternateEnabled(light) light.Enabled = light.Enabled and false or true end while wait(intervals) do alternateEnabled(red) alternateEnabled(blue) end
That should work.
~ Oh, I'm sorry, did I break your concentration? ~ |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 13 Aug 2013 08:19 PM |
QUITE: Oh, POLICE light bar. Dang I was confused. Anyways, have a model with the two parts you want to flash named 'Red' and 'Blue'. Then, insert a PointLight into both and color it appropriately. Insert this script into the model:
try this, the only reason this wouldn't work is if you don't follow his instructions (i made a few tweaks)
local intervals = 0.5 -- change to seconds between flashing local red = script.Parent.Red.PointLight local blue = script.Parent.blue.PointLight function alternateEnabled(light) if light.Enabled then light.Enabled = false else light.Enabled = true end while wait(intervals) do alternateEnabled(red) wait(intervals) alternateEnabled(blue) end |
|
|
| Report Abuse |
|
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 13 Aug 2013 08:25 PM |
Above's is the expanded version of mine, good for clarity :P
~ Oh, I'm sorry, did I break your concentration? ~ |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Aug 2013 08:40 PM |
@hurt it WILL WORK IF you follow the instructions given to you.
Make a model:
inside the model should look like this -THE SCRIPT -"Red" ------PointLight -"Blue" ------PointLight |
|
|
| Report Abuse |
|
|
|
| 13 Aug 2013 08:50 PM |
light.Enabled = light.Enabled and false or true
EW
light.Enabled = not light.Enabled |
|
|
| Report Abuse |
|
|