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

How do i make this kind of script work?

So I am trying to make a script where your PointLight in game will flicker on and off so i am thinking something like this


Wait(2)
while true do
game.Workspace.CeilingLight.Brightness =  0
 end

Anyonw who can help?

3 answers

✓ Accepted answer

All you're doing in that script is waiting 2 seconds and then repeatedly turning the brightness to 0 without resetting it. To make it flicker you want it to reset and then go out again repeatedly.

while true do
	game.Workspace.CeilingLight.Brightness = 0
	wait(2)
	game.Workspace.CeilingLight.Brightness = 1
	wait(2)
end

I hope this helps!

Wait=workspace:WaitForChild("CeilingLight")

while wait(math.random(1,5))do
Wait.Brightness =  0
wait(math.random(1,5)) --Gives bit more of a flickering affect., turning it off and on at random timings
Wait.Brightness =  1
end

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