What do you add to make it so it checks how long the light is on. Thanks.
-- ProductOfDevs
local battery = 100
function onClicked()
if battery ~= 0 then
if script.Parent.PointLight.Enabled == false then
script.Parent.Sound:Play()
script.Parent.PointLight.Enabled = true
script.Parent.Material = 'Neon'
elseif script.Parent.PointLight.Enabled == true then
script.Parent.Sound:Play()
script.Parent.PointLight.Enabled = false
script.Parent.Material = 'Sand'
end
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)

1 comment
I tried that but it seems to just not work without an error message.