I'm trying to make it to where when I use a proximity prompt, the LIGHTS turn on. I don't have any code snips since I don't have a clue on how to even start.
COMMUNITY QUESTION
How do you deal with multiple models using one script?
1 answer
local lightsFolder = workspace.LightsFolder:GetChildren() --Light Model (NOT THE SAME PART/MODEL AS THE PROXIMITY PROMPT)
script.Parent.ProximityPrompt.TriggerEnded:Connect(function()
for i,v in pairs(lightsFolder) do
v.PointLight.Enabled = true
end
end)
This will turn the lights under the model/Folder on (it will not turn them off)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
To make them flip between on and off you can use v.PointLight.Enabled = not v.PointLight.Enabled instead of v.PointLight.Enabled = true on line 5. Note that this just flips the value. If some are on and others are off, the ones that are on will turn off and vice versa.