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 » Scripters
Home Search
 

Re: Flickering light script

Previous Thread :: Next Thread 
mechasaultfreak2 is not online. mechasaultfreak2
Joined: 12 Jul 2009
Total Posts: 47
11 Mar 2015 08:01 PM
How would I get a light to flicker at random times with a script?
Report Abuse
memorycode is not online. memorycode
Joined: 24 Sep 2011
Total Posts: 3322
11 Mar 2015 08:01 PM

math.random() that biz

have you done anything yet? do you need a psuedo-script or something?

those four years of wumbology are really paying off
Report Abuse
mechasaultfreak2 is not online. mechasaultfreak2
Joined: 12 Jul 2009
Total Posts: 47
11 Mar 2015 08:03 PM
Yea I just started scripting yesterday and trying to learn
Report Abuse
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
11 Mar 2015 08:43 PM
gl.
Report Abuse
drager980 is online. drager980
Joined: 25 May 2009
Total Posts: 13385
11 Mar 2015 08:45 PM
i wont reveal how to do most of it but
while wait(7) do
x.Enabled = false
wait()
x.Enabled = true
wait(0.2)
x.Enabled = false
wait(0.3)
x.Enabled = true
end
define x for yourself
Report Abuse
drager980 is online. drager980
Joined: 25 May 2009
Total Posts: 13385
11 Mar 2015 08:46 PM
my bad
while true do
x.Enabled = false
wait()
x.Enabled = true
wait(0.2)
x.Enabled = false
wait(0.3)
x.Enabled = true
wait(math.random(10))
end
Report Abuse
KLGA is not online. KLGA
Joined: 19 Apr 2014
Total Posts: 2571
11 Mar 2015 08:57 PM
@drager
that's not a very efficient way to do it.
Report Abuse
drager980 is online. drager980
Joined: 25 May 2009
Total Posts: 13385
11 Mar 2015 11:25 PM
and your more efficient way would be..?
note: he's just getting into scripting,
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
11 Mar 2015 11:28 PM
-- Script inside of a part.

local part = script.Parent;
local light = part:FindFirstChild('PointLight') -- Change to name of light in part

while wait(math.random(5) / 5) do
light.Enabled = not light.Enabled;
end

Report Abuse
cxcharlie is not online. cxcharlie
Joined: 26 Aug 2009
Total Posts: 1414
12 Mar 2015 12:00 AM
Use sine and cosine...
for i=1,math.huge do
wait()
light.Brightness=math.sin(tick()*5)
end
Report Abuse
LucasLua is not online. LucasLua
Joined: 18 Jun 2008
Total Posts: 7386
12 Mar 2015 12:03 AM
sine and cosine give very pretty and consistent patterns. :3
Report Abuse
cxcharlie is not online. cxcharlie
Joined: 26 Aug 2009
Total Posts: 1414
12 Mar 2015 12:18 AM
fine,

while wait() do
local r=math.random()/2--edit if u want
light.Brightness=math.sin(tick()+r)*(1+r)
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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