--made with help of raidersky,s lua (THANK YOU)



local M = {}

local lightsPDState = 0
--CREDITS FOR THIS LUA: RAIDERSKY
--local ToggledAlley = false
--local PDlights = 0

local function onInit()
    electrics.values['RPM_led1'] = 0
    electrics.values['RPM_led2'] = 0
    electrics.values['RPM_led3'] = 0
    electrics.values['RPM_led4'] = 0
end

local function onReset()
    onInit()
end

local function updateGFX(dt)

    if electrics.values['rpm'] > 4500 and electrics.values['rpm'] < 12000 then
       electrics.values['RPM_led1'] = 1 else electrics.values['RPM_led1'] = 0
    end
	
    if electrics.values['rpm'] > 7500 and electrics.values['rpm'] < 12000 then
       electrics.values['RPM_led2'] = 1 else electrics.values['RPM_led2'] = 0
    end
	
    if electrics.values['rpm'] > 8000 and electrics.values['rpm'] < 12000 then
       electrics.values['RPM_led3'] = 1 else electrics.values['RPM_led3'] = 0
    end

    if electrics.values['rpm'] > 8500 and electrics.values['rpm'] < 12000 then
       electrics.values['RPM_led4'] = 1 else electrics.values['RPM_led4'] = 0
    end
	
    if electrics.values['rpm'] < 500 then
       electrics.values['RPM_ledoff'] = 1 else electrics.values['RPM_ledoff'] = 0
    end
	
--CREDITS FOR THIS LUA: RAIDERSKY

end

--CREDITS FOR THIS LUA: RAIDERSKY
-- public interface
M.onInit      = onInit
M.onReset     = reset
M.updateGFX = updateGFX

return M