So I have this script which is supposed to reproduce a sort of flashing neon, the script functions because in the output in prints 'Script Works' after every loop. However, my problem is that the color and the material of the brick don't change at all, they stay the exact same.
local material = script.Parent.Material
local color = script.Parent.BrickColor
function change_mat()
material = Enum.Material.Neon
wait(1)
material = Enum.Material.Plastic
wait(5)
material = Enum.Material.Neon
wait(.5)
material = Enum.Material.Plastic
end
color = 'Red'
while true do
change_mat()
wait(1)
print('Script Works')
end

1 comment
I think the probably is assigning the parts property to a variable. Maybe, just define the part instead.