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
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