Like clicking or touching a brick so it will turn on
COMMUNITY QUESTION
How to make dynamic lighting turn on when touched or clicked?
1 answer
Clicked:
Add ClickDetector To Part.
Add to part: Light, script and clickdetector.
Lua:
script.Parent.ClickDetector.MouseClick:connect(function()
if script.Parent.Light.Enabled == true then
script.Parent.Light.Enabled = false
else
script.Parent.Light.Enabled = true
end
end)
Touched:
Add to part: Script and light.
Lua:
script.parent.Touched:connect(function()
if script.Parent.Light.Enabled == true then
script.Parent.Light.Enabled = false
else
script.Parent.Light.Enabled = true
end
end)
Its simple just learn if.
This discussion is preserved as it was. New answers, comments, and votes are closed.
