function init()
	light = FindLight("light")
    
	speed = GetFloatParam("speed",math.random() * 4.0 + 1)
	duration = GetFloatParam("duration",0.5)
    offset = GetFloatParam("offset",0)
    
	blinkTimer = 0 + offset
	doBlink = true
end


function tick(dt)
	blinkTimer = blinkTimer + (dt * speed)
	local t = math.mod(blinkTimer, 1.0)

	if doBlink then
		--Light blink
		if t < duration then
            SetLightEnabled(light, true)
		else
            SetLightEnabled(light, false)
		end
	end
end

