--Function requires the same name as the file local soundPlaying = 0 --local vol = 100 -- water volume local trigger = 3000 -- activate distance local sound_entity = 125 --entity assigned to this lua file function river_sound_init(e) end function river_sound_main(e) if GetPlayerDistance(sound_entity) < trigger then ActivateIfUsed(sound_entity) if soundPlaying == 0 then --SetSoundVolume(vol) PlaySoundIfSilent(e,0) end else if GetPlayerDistance(sound_entity) > trigger then StopSound(sound_entity, 0) end end end