[ROBLOXCRITICAL] 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 the light has turned off. but the script flickers the point light but dont change the material. The light part is on the “StreetLight” model. (I don’t know 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 You’re Help :slight_smile:

1 Like

Ummm. [ROBLOXCRITICAL] is reserved for VERY SPECIAL CASES where the PLATFORM ITSELF went DOWN. A MINOR BUG OR SO doesn’t require SUCH URGENCE.

But platform did going down? My game isnt working

Have you debugged the code?
To make sure the materials arent actually changing?

Yes there not changing not matter what i do

Are you sure? abcedfghijklmnopqrs

Just test it using the command bar. Make sure EmitPart is a BasePart. Robloxcritical isn’t important here, the platform is not down because your your model doesn’t change material