Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why won't my light script flash the light?

while true do
	script.Parent.PointLight.Range = 60
	wait(1)
	script.Parent.PointLight.Range = 1
end

This is the script I'm working with right now. What it's doing is alternating the PointLight's range from 60 to 1 every second.

For some reason, it isn't working. I don't know what I'm doing wrong, I thought it was right at first. Thanks in advance.

2 comments

0

Silly question, but is the pointlight on?

0

Where is the PointLight located at? In a part with a PointLight and this script? Make sure next time if you have a problem like this again, indicate where the light is at.

2 answers

You likely need a wait after you set the Range to 1, or before you set it to 60. The wait time between those is basically instantaneous to our eyes, so it will appear as if it doesn't change at all.

--Make sure 'PointLight' is the same name as the object you have named.

while true do
    script.Parent.PointLight.Range = 60
    wait(1)
    script.Parent.PointLight.Range = 1
    wait(1) --Need a wait here.
end

This discussion is preserved as it was. New answers, comments, and votes are closed.