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

How i make two or more lights on?

Asked by 9 years ago

i have this scripts

bin = script.Parent

function onClicked(mouse)

script.Parent.Parent.Light.Lamp.Enabled = true

end

bin.ClickDetector.MouseClick:connect(onClicked)

bin = script.Parent

function onClicked(mouse)

script.Parent.Parent.Light.Lamp.Enabled = false

end

bin.ClickDetector.MouseClick:connect(onClicked)

but if i copy the light don't work with the two lights

How i make the two models lights on?

1 answer

Log in to vote
0
Answered by 9 years ago
bin = script.Parent
local toggle = false

function onClicked(mouse)
if toggle == false then
toggle = true
script.Parent.Parent.Light.Lamp.Enabled = true
toggle = false
script.Parent.Parent.Light.Lamp.Enabled = false
end
end

bin.ClickDetector.MouseClick:connect(onClicked)
0
no no, what I wanted was two models two lamps and if o press the button the two lamps turn on 12345gabriel12345 15 — 9y
0
welp :( Anthony9960 210 — 9y
Ad

Answer this question