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

A very simple script that isn't working for some reason. Any help?

Checks if SpotLights are enabled, if true, make the brick (lights) neon. No idea why it's not working, so trying to get some help here.

while wait() do
	if script.Parent.L.Main.Enabled == true or script.Parent.L.Fog.Enabled == true then
		script.Parent.L.Material = "Neon"
		script.Parent.R.Material = "Neon"
	else
		script.Parent.L.Material = "SmoothPlastic"
		script.Parent.R.Material = "SmoothPlastic"
	end
end

1 comment

0

What is in the Output?

1 answer

Use Enum.Material for changing Materials

while wait() do
    if script.Parent.L.Main.Enabled == true or script.Parent.L.Fog.Enabled == true then
        script.Parent.L.Material = Enum.Material.Neon
        script.Parent.R.Material = Enum.Material.Neon
    else
        script.Parent.L.Material = Enum.Material.SmoothPlastic
        script.Parent.R.Material = Enum.Material.SmoothPlastic
    end
end

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