Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make this kind of script work?

Asked by 10 years ago

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

Log in to vote
1
Answered by 10 years ago

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
Ad
Log in to vote
0
Answered by 10 years ago

thanks for you code FearMe

Log in to vote
0
Answered by 10 years ago

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

Answer this question