So the following code is supposed to create functioning indicators, but my output was telling me I was giving the "Material" property an invalid enum value for material.
I have tried using a ternary operator, but instead of returning "SmoothPlastic" when state = true, it simply returns true. However in the first running of this loop, when state = false.. my indicators are infact set to neon.
Why is it doing this? I have used ternary operators before and it has not behaved like this, am I missing something? My code is as follows:
local state = false
while indicate == 2 do
for i, v in pairs (script.Parent.Parent.Parent.Indicators:GetChildren()) do
if v.Name == "IndicatorR" then
local mat = state or "SmoothPlastic" and "Neon"
print(mat)
-- For demonstration purposes.
v.Material = state or "SmoothPlastic" and "Neon"
end
end
script.Parent.Indicator:Play()
wait(0.5)
state = not state
end
As always, I appreciate your time and efforts. :)

3 comments
Thank you, video was helpful too!
Cool, glad it helped :D
+1 for excellent video.