Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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?

0
I tried that but it seems to just not work without an error message. productofdevs 1 — 4y
Ad

Answer this question