generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Light Bar

Previous Thread :: Next Thread 
hurtripley is not online. hurtripley
Joined: 18 Sep 2011
Total Posts: 1341
13 Aug 2013 07:50 PM
How do i make like a polic lightbar that keeps flashing? Im new to scripting.
Report Abuse
hurtripley is not online. hurtripley
Joined: 18 Sep 2011
Total Posts: 1341
13 Aug 2013 07:51 PM
*police
Report Abuse
MHebes is not online. 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
hurtripley is not online. hurtripley
Joined: 18 Sep 2011
Total Posts: 1341
13 Aug 2013 08:08 PM
@MH Didnt work.
Report Abuse
hurtripley is not online. hurtripley
Joined: 18 Sep 2011
Total Posts: 1341
13 Aug 2013 08:15 PM
Someone Help!
Report Abuse
Clayguy247 is not online. Clayguy247
Joined: 03 Sep 2008
Total Posts: 3394
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 is not online. 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
hurtripley is not online. hurtripley
Joined: 18 Sep 2011
Total Posts: 1341
13 Aug 2013 08:30 PM
I give up, Nothing works.
Report Abuse
Clayguy247 is not online. Clayguy247
Joined: 03 Sep 2008
Total Posts: 3394
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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
13 Aug 2013 08:50 PM
light.Enabled = light.Enabled and false or true

EW

light.Enabled = not light.Enabled
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image