Sorry, this was actually made in the S&L forum, but it got closed. I thought I'd better post it here.

So I have this riff, the main riff of a song I'm working on. (Drop D)

D -0-0-0--0--0--0-0-0--0--0--0-0-0--0--0--0--0--

Can anyone tell my what sort of rules would apply to riffs that would work with that one? How can I tell what key it's in, and are there notes I can't use in riffs in the same song as this one? Help me please.

Sorry about the copypaste, but I would like to know.
My stuff

Gibson Les Paul Studio
Ibanez ADC120
Tanglewood TGRF VS
Blackstar HT20
Roland Micro Cube
It's in D minor. You can use any notes you like as long as it sounds good to you. There's no rules in music.
It's a somewhat ambiguous D Minor scale (the 6th and 4th aren't explicit). The rules you apply depend entirely on what you want to accomplish with the piece. Start with D Natural Minor and experiment with alterations.
Yep, this is in D minor. If you're having trouble figuring out the key, label out all the notes you are using. In this case you are using: D, E, F, A, C; next you would want to figure out what note sounds like 'home' which would just so happen to be D since you seem to be so happily chugging away on it.

So if we order all the notes from D we get D E F A C; the closest key to this is D minor, D E F G A Bb C.

░░/ ░░░ \░░░____________
/░░░ರೃ \░░/Presumptuous!\
░░ \░^░/ ░░
D minor. Technically, music has no rules like "griffRG7321" said. But music has a set of... suggestions that for some reason imply to people that these are rules you can't break or you'll be ridiculed in the clique of musicians, but yet musicians like Joe Satriani, John Petrucci, and many more are considered the best of the best, the leaders of the pack of guitarists, are the ones that are called geniuses, and they are! But your average musician doesn't like to stray away from the safe zone of the "scale." It's only the people that break the rules that are the people who are praised and made famous. So yes. D minor.