I've been playing guitar and bass for a few years but am a bit stuck with writing music.

I have chord progressions and riffs that I like but can you tell me how I go from there?
How do I find out what key I am in and how can I arrange other riffs/ instruments around it?

Like I said, I'm just stuck after I have one or 2 basic parts.
erm. whatever chord sounds like it ends it, resolves it or whatever, that's usually the key that you're in.

to come up with melody lines, i'd recommend just improvising over a chord progression (if u can record it, or get a friend to play it) and when you hit certain notes that fit in nicely, try and work a melody around them.
yeah starting with words is easier (i find) 'cause then you can take a chord progression (maybe one you've already come up with) or a riff and use it on the words instead of trying to come up with a whole melody without words. the melody usually comes out of the words anyways, so that's why i like writing words first.
wat i do when i'm in a situation like that is i just sing "la la la" in what i think sounds good with the chord progressions and all, then find words to fit. do you get what i'm saying? Just think about what u want to write about and just sing away with the instramentals you made.
You can do a lot just with a rif and chord progression without new inspiration.Build a second guitar playing the chords different,strumming,picking or find a catchy rhythm.Also new riffs you can find out the chord progression. For vocals you can always start with doubling the melody you hear from your instrument and so on. You literally got to PLAY with what you start with and you'll come up with more things.Good luck!
if your like me you just find chords that sound good then just pick a topic to write about and just say stuff that makes since