@name Soundemitter
@inputs 
@outputs 
@persist Current 
@trigger 
interval(100)

if (first()) {
    Current = 1
}

Run = array(
    "vo/npc/male01/runforyourlife01.wav",
    "vo/npc/male01/runforyourlife02.wav",
    "vo/npc/male01/runforyourlife03"
    )
Cp = array(
    "vo/npc/male01/cps01.wav",
    "vo/npc/male01/cps02.wav",
    "vo/npc/male01/civilprotection01.wav",
    "vo/npc/male01/civilprotection02.wav"
    )

RunB = owner():keySprint()

if (changed(RunB) & RunB) {
    owner():soundPlay(1,0,Run[Current,string])
} elseif (!RunB) {soundStop(1)}

timer("Changer",4000)
if(clk("Changer")){Current+=1}
if(Current>=4){Current=1}
