I am trying to make a light on and light off script but I can't remember how to make it so the script waits for the light to be created.
lightOn = false
SmoothBlockModel = script.Parent
function onClicked()
if lightOn == false then
local l = Instance.new("PointLight")
l.Brightness = 4
l.Range = 5
l.Parent = script.Parent
lightOn = true
end
if lightOn == true then
script.Parent.PointLight:Destroy()
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

4 comments
This would still break, LOL
It wouldnt actually
Dont dj
Dont disrespect other peoples work. Or themselves follow the community guidelines.*