Changing materials using a script

  1. What do I want to achieve?
    I am making a script which changes the material of a part after every 1 second forever.

  2. What is the issue?
    I don’t know the issue but the material isn’t being changed

Here is my script

while true do
	wait(1)
	script.Parent.Material.new = SmoothPlastic
	wait(1)
	script.Parent.Material.new = Neon
	
end

Can you please tell what error I made.

Thanks for reading :slight_smile:

1 Like

That’s not how you change a Material, no need for the .new, also, that acts as a variable, so put quotation marks around SmoothPlastic and Neon

But I recommend using a Material Enum

while true do
	wait(1)
	script.Parent.Material = Enum.Material.SmoothPlastic
	wait(1)
	script.Parent.Material = Enum.Material.Neon
end
2 Likes