Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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
0
What is in the Output? itz_rennox 412 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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
Ad

Answer this question