It says "Pan.Tilt.Mesh" is not a valid member of model?
local dir = "Pan.Tilt.Mesh"; local mac ={workspace.Mac1,workspace.Mac2,workspace.Mac3,workspace.Mac4,workspace.Mac5,workspace.Mac6,workspace.Mac7,workspace.Mac8} function Clicked() if script.Parent.Bool.Value == false then for i,v in pairs(mac) do v[dir].Transparency = v[dir].Transparency + 0.5 script.Parent.Bool.Value = true end end end script.Parent.MouseButton1Down:connect(Clicked)
With string.gmatch you can get the location with the string as shown below.
local dir = "Pan.Tilt.Mesh"; local mac ={workspace.Mac1,workspace.Mac2,workspace.Mac3,workspace.Mac4,workspace.Mac5,workspace.Mac6,workspace.Mac7,workspace.Mac8} function Clicked() if script.Parent.Bool.Value == false then for i,v in pairs(mac) do local d = v for k in dir:gmatch('[^.]+') do d = d[k] end d.Transparency = d.Transparency + 0.5 script.Parent.Bool.Value = true end end end script.Parent.MouseButton1Down:connect(Clicked)