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

how to make the screen go black when all 10 light objects are clicked and switched off?

Asked by 4 years ago

i have 10 lights. when they're switched off, i want the user's whole screen to go black.

how do i make a condition for if ALL 10 lights off, the frame i made becomes visible (aka a black screen)

i've made a script that will turn the lights off when they are clicked, but i can't figure out if i am meant to use some kind of count system where it adds 1 each time they are clicked until it gets to 10? or do i have to make each part's script have a true/false for if its on function or if there's a better way to do this?

it seems that when i make the separate script in screengui folder it doesnt recognise the variables? is it bc they are local?

anything around this topic would be helpful. sorry if this is vague

0
just use bindable functions and use a variable counting upwards. Thesquid13 301 — 4y

Answer this question