Alright so I have this script that is supposed to loop through a folder and if it finds a descendant that has a specific names it gives it pathways to global parts (ViewPart, Icon, etc) and ViewPart is causing problems here. The error says it isn’t a valid member of BillboardGui even though it is in a model.
There could be something named similarly inside the MonitorProxTemplate BillboardGui since you are looping through every descendant of the folder, making it pass the name check and try to access ViewPart (which doesn’t exist there, giving the error)
I can safely say that it is because of the fact that you’re basically looking for a non-existent instance.
Here is the code:
for i, monitor in pairs(WorkingMonitors:GetDescendants()) do
local MonitorName = tostring("Monitor" .. i)
if monitor.Name == MonitorName then
for i, v in pairs(monitor:GetDescendants()) do
if v.Name == "MonitorOrder" then
local PlayerViewPart = monitor.ViewPart
local Icon = monitor.ExampleMonitor.MonitorProxTemplate
Let me know if I have made a mistake since I’ve written a code without using studio to check if it’s correct.