--thanks Yokai for help w/ script

local data  = ac.getCarState(1)
local volume = ac.getAudioVolume("main") * 20
local etc = ui.MediaPlayer('melody_sounds/ninja.mp3'):setVolume(volume)
local retry = true

function script.update(dt)
    if data.isAIControlled then return end

    if retry and data.rpm > 200 then
		if (etc:ended()==false and etc:playing()) then return end
		etc:play()
		retry = false
	end
	
	if (data.rpm < 200) then retry = true end
end