of     1   

Pyskshi
#227978087Saturday, November 25, 2017 1:35 AM GMT

Greetings, I have been trying to script some lights that are in one model and change all of their SurfaceLights so when I click the ON button they all turn on and every single SurfaceLight of theirs changes properties. Here is the script I have tried: neonmain1 = game.Workspace.neonlights1.neonmain1 neonmodel1 = game.Workspace.neonlights1.neonmain1.neonmodel1:GetChildren() neonmodel2 = game.Workspace.neonlights1.neonmain1.neonmodel11:GetChildren() onclick1.MouseClick:Connect(function() neonmodel1.Material = "Neon" neonmodel2.Material = "Neon" end) offclick1.MousClick:Connect(function() neonmodel1.Material = "SmoothPlastic" neonmodel2.Material = "SmoothPlastic" end) What the names look like in Explorer: Explorer Workspace neonlights1 neonmain1 neonmodel1 neon1 Surface1 ne##### Surface1 neon1 Surface1 neon1 Surface1 neon1 neonmodel2 neon2 Surface2 neon2 Surface2 neon2 Surface2 neon2 Surface2 neon2 On1 OnClick1 Off1 ######### What would I do to change all of the SurfaceLights at once aswell as the neon1 and neon2 part to neon when on and SmoothPlastic when off. -Thanks for the help :D
Ezuras
#227978693Saturday, November 25, 2017 1:47 AM GMT

What you're doing is incorrect. :GetChildren returns a table of objects, not the actual objects themselves. You could try using this: local NeonLightModel = path_to_model for Index, Object in pairs(NeonLightModel:GetChildren()) do if Object:IsA("Part") then Object.Material = "Neon" end end
Pyskshi
#227979056Saturday, November 25, 2017 1:54 AM GMT

Where would you put that?
IAmBW
#227979287Saturday, November 25, 2017 1:58 AM GMT

you misspelled mouseclick
Pyskshi
#227979534Saturday, November 25, 2017 2:01 AM GMT

Where would you put that?

    of     1