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

Why is the flickering not happening?

Hello. I am making a part in which the light flickers. For some reason, it isn't working. Please answer. Here's the script:

local Light = script.Parent.PointLight
local Part = script.Parent

while true do
	Light.Brightness = 10
	Part.Material = "Neon"
	Part.BrickColor = "Cool Yellow"
	wait(5)
	Light.Brightness = 0
	Part.Material = "SmoothPlastic"
	Part.BrickColor = "Fossil"
	wait(0.3)
	Light.Brightness = 10
	Part.Material = "Neon"
	Part.BrickColor = "Cool Yellow"
	wait(3)
	Light.Brightness = 0
	Part.Material = "SmoothPlastic"
	Part.BrickColor = "Fossil"
	wait(0.3)
end

1 answer

Put wait() after the loop and to change color with a script you need to use Color3.fromRGB(0,0,0)

Example:

local Light = script.Parent.PointLight
local Part = script.Parent

while true do
    wait()
    Light.Brightness = 10
    Part.Material = "Neon"
    Part.BrickColor = Color3.fromRGB(0,0,0) -- Change the rgb to the rgb value for yellow
    wait(5)
    Light.Brightness = 0
    Part.Material = "SmoothPlastic"
    Part.BrickColor =  -- Change the rgb to the rgb value for fossil
    wait(0.3)
    Light.Brightness = 10
    Part.Material = "Neon"
    Part.BrickColor = Color3.fromRGB(0,0,0) -- Change the rgb to the rgb value for yellow
    wait(3)
    Light.Brightness = 0
    Part.Material = "SmoothPlastic"
    Part.BrickColor = Color3.fromRGB(0,0,0) -- Change the rgb to the rgb value for fossil
    wait(0.3)
end

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