Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Disabling multiple GUIs in different models?

Asked by 5 years ago

So I am making a script inside a button that once is clicked changes several stuff (OnClicked function). I have several lamps (models) with two GUIs inside of them displaying two images, this kind of works like a light switch, when I click it, the GUIs Enabled = false command is activated making the lamps look like they are off, however, only one of the lamps is turned off because I don't know how to use GetChildren with GUIs to get every lamp (with the same model name) disabled:

game.Workspace.GroupLamp.Lamp.Lamp.Lightbulb.BillboardGui.Enabled = false
game.Workspace.Group.Lamp.Lamp.Lightbulb.Light.Enabled = false
game.Workspace.Group.Lamp.Lamp.Lightbulb.PointLight.Enabled = false

I've tried every GetChildren line I could think off, but none worked, anyone can help?

Answer this question