Enum.Material Not Working

Hello DevFourm, I have been working on a horror game. In this horror game, I want some lights to flicker. However, I scripted a script to make a point light look like it’s flickering when changing the light parts material to SmoothPlastic making it look like the light has turned off, but the script flickers the point light but doesn’t change the material. The light part is in the “StreetLight” model. (I don’t know if that changes anything)

Here’s the Script:

local Light = script.Parent
local EmmitPart = script.Parent.Parent

while wait(5) do
	Light.Brightness = 0
	EmmitPart.Material = Enum.Material.SmoothPlastic
	wait(0.1)
	Light.Brightness = 5.26
	EmmitPart.Material = Enum.Material.Neon
	wait(0.3)
	Light.Brightness = 0
	EmmitPart.Material = Enum.Material.SmoothPlastic
	wait(0.4)
	Light.Brightness = 5.26
	EmmitPart.Material = Enum.Material.Neon
	wait(0.3)
	Light.Brightness = 0
	EmmitPart.Material = Enum.Material.SmoothPlastic
	wait(0.5)
	Light.Brightness = 5.26
	EmmitPart.Material = Enum.Material.Neon
	wait(0.2)
	Light.Brightness = 0
	EmmitPart.Material = Enum.Material.SmoothPlastic
	wait(0.3)
	Light.Brightness = 5.26
	EmmitPart.Material = Enum.Material.Neon
	wait(0.3)
	Light.Brightness = 0
	EmmitPart.Material = Enum.Material.SmoothPlastic
	wait(0.2)
	Light.Brightness = 5.26
	EmmitPart.Material = Enum.Material.Neon
end

Thanks For Your Help :slight_smile:

Never Mind, I fixed the problem.