NOTE: I KNOW HOW TO GET THE PARENTS, ALL PARENTS ARE RIGHT AND THE MATERIAL OF SCREEN IS FOIL!! HELP PLEASE!
--//Variables Button = script.Parent Screen = script.Parent.Parent.Screen --//Function Button.ClickDetector.MouseClick:connect(function() for i,v in pairs {Screen} do if v.Material == "Foil" then print"Worked2" v.Material = "Neon" end end end)
error is on line 9.
you need use Enum to tell the script what material you are talking about.
so,instead of using: if Material == "Foil"
you should use:Material == Enum.Material.Foil
so i went ahead and re-made your script.
i tested this new script hope it works for you too
--//Variables Button = script.Parent Screen = script.Parent.Parent.Screen:GetChildren() --//Function Button.ClickDetector.MouseClick:connect(function() for i=1, #Screen do if Screen[i].Material == Enum.Material.Foil then print"Worked2" Screen[i].Material = Enum.Material.Neon end end end)
hope this works
lukeb50