Hello there, I'm new scripter, of course still learning. I am having trouble with this lines, it's really bother, giving me headache.
Locals scripts that will might help you to understand local lights = {} local static = true local dis = false local area = Workspace.Rig:GetChildren() for i=1,#area do table.insert(lights,area[i]) end V That script I'm having trouble V function Alarm() if script.Parent.alarm.Text == "Activate Alarm" then script.Parent.alarm.Text = "Deactivate Alarm" for i,v in next, workspace.Rig:GetChildren() do v.Static.Light.Toggle = true end else script.Parent.alarm.Text = "Activate Alarm" for i,v in next, workspace.Rig:GetChildren() do v.Static.Light.Toggle = true end end end
The error was
14:57:57.436 - Static is not a valid member of Model 14:57:57.438 - Script 'Workspace.Model.Screen.SurfaceGui.ImageLabel.Script', Line 266 14:57:57.440 - Stack End
?
According to your comment, (http://prntscr.com/bg0zoe) each member of "Rig" is named "Static," but you are trying to access Rig.Static.Static, rather than simply Rig.Static. Here's the fixed code:
Locals scripts that will might help you to understand local lights = {} local static = true local dis = false local area = Workspace.Rig:GetChildren() for i=1,#area do table.insert(lights,area[i]) end V That script I'm having trouble V function Alarm() if script.Parent.alarm.Text == "Activate Alarm" then script.Parent.alarm.Text = "Deactivate Alarm" for i,v in next, workspace.Rig:GetChildren() do v.Light.Toggle = true end else script.Parent.alarm.Text = "Activate Alarm" for i,v in next, workspace.Rig:GetChildren() do v.Light.Toggle = true end end end