How to Make Flickering Lights
Download – Flickering Lights Model and Script
How To – Make Flickering Lights in Roblox Studio
What’s up everyone, BuzzyBeth here – In this tutorial we’ll be learning how to make flickering lights at random intervals!
- I created this very simple lamp post just composed of three different parts. It’s just two black parts and then the yellow part is going to be my light source.
- Inside of that part i’m gonna go ahead and add a light source. You guys can use a point light, spotlight, or surface light either or is okay, but I want to use a spotlight to give that head-on effect with the light.
- It’s not facing the right way so i’ll be changing that inside of the properties menu. Then change the brightness of it by using the slider.
- Add a script inside of our part. We have a few variables, one which references our spot light and the second one is going to be just our part.
- Now we’re going to create a while true do loop and the light is going to be disabled. We’re actually going to do math.random(0, 1) which means it can wait between 0 to 1 seconds. We’ll let them randomly choose how long it’s going to occur before light.enabled is equal to true.
- Then we’re gonna do the same thing, we’re gonna do math.random for the wait time, but this time we’ll do zero to two seconds and then we’ll let the code choose the random time because we want this to be a random flicker!