How to make a flickering light on a rope in 4 simple Steps

Step 1 [LIGHT]

Add a Point Light to a Part.
image

Step 2

Add a Script to the Part.
image

Step 3

In the Script write the following:

while true do
	script.Parent.PointLight.Enabled = true
	wait(0.5)
	script.Parent.PointLight.Enabled = false
	wait(0.5)
end

You can change the “(0.5)” to any amount of seconds you want.

Step 4 [ROPE]

At the top of the screen, go to MODEL tab and on the righter side where it says Constraints select the little arrow pointing down at the top left button of the Constraints section. There you will select Rope.
image image image
You will then select the part you want to attach it to, as well as the Part which the light is at, which will connect the 2 parts with the rope.


Make sure to have your Light Part not Anchored so that the light part can be moving around freely on the rope as it would in real life. (Can do so by selecting the part and unselecting “Anchored” in Properties)

Extra

If you want to make it look nicer, you can modify the script however you like, you can play around with numbers however you like and make as many as you want different combinations.

while true do
script.Parent.PointLight.Enabled = true
wait(1)
script.Parent.PointLight.Enabled = false
wait(0.3)
script.Parent.PointLight.Enabled = true
wait(0.7)
script.Parent.PointLight.Enabled = false
wait(0.2)
script.Parent.PointLight.Enabled = true
wait(3)
script.Parent.PointLight.Enabled = false
wait(0.1)
script.Parent.PointLight.Enabled = true
wait(0.7)
script.Parent.PointLight.Enabled = false
wait(0.2)
end

ENJOY! :smiley:

9 Likes

I would refrain from using while loops, they arent the best, also use task.wait() instead! Its much better. Apart from that great tutorial

1 Like

You could simplify this to

while true do
    script.Parent.PointLight.Enabled = not script.Parent.PointLight.Enabled
    task.wait(math.random(1, 100)/100)
end
13 Likes

That is actually smart, thank you, didn’t think of that. :smiley:

But in the image it says Point Light.

2 Likes

then use point light or use spot light if it works better ez

1 Like

Right, fixed, thank you for that… I am blind apparently… probably was thinking of something else when writing.

1 Like

instead of: script.Parent.PointLight.Enabled = false
you can do: local Light = game.workspace.Part.PointLight
making it: Light.Enabled = false/true

1 Like