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

What do you add to make it so it checks how long the light is on?

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 answer

the only thing I can say is a number value and a script that changes the value +1 every second then an if statement checking what the numbers on?

1 comment

0

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

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