Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How i make two or more lights on?

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

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)

2 comments

0

no no, what I wanted was two models two lamps and if o press the button the two lamps turn on

0

welp :(

This discussion is preserved as it was. New answers, comments, and votes are closed.