how do i know what key my riffs are in?

im in a band and weve just started out but ive got all these funky riffs goin about,but i dont know what there in,i meani know like if i use the notes from say an A scale then its in A
but what about just riffs everywhee on the fingerboard.
thanks
happyhourman

Assuming your songs are tonal in nature (which they probably are) look for a I-V-I relationship, I being the first chord in the scale, V being the fifth. This is the most common and obvious way to find the key center of a song, as probably 90% of western music, regardless of style, uses V-I as the basis for cadences.

So if a song is in say, A minor, you'll have an A minor chord (ACE), moving to an E (either minor major, usually major) made up of EG or G# and B, and then ending on A minor again.

If you can't find a solid V-I look at the notes that make up the riff and try to figure out what key most of them belong to (you often borrow notes from outside the key for variety). Then look at what chords you are playing, particularly what ones you use at your riff endings and turnarounds. Usually these will be some kind of cadence (like the aforementioned V-I, or sometimes a IV-I or more rareley a V-vi).