what are some ways i could practice making my leads flow better and stay on beat?
In other words, tips on playing music?

Practice, mate.

Slow down, use a metronome, mute unwanted strings, listen to people you want to sound like and learn how they played what they played.
the only thing that i can really think for that is practice practice practice. and if you improv more leads then as you progress the ones you write will be easier to keep on time and flow better.

ok, cuz lately i've been jamming with my friends and i've been going off beat. should i practice triplets and stuff like that?
take a song or 2 you know and like take a look at the solo for it. break it down and see what scales they are using then do this.

phase 1: play leads in their style pull a few key phrases so it sounds like more of an improvised solo and play it with the song or however you want to practice it that way. basically improvise using the same scale patterns originally used in the song

phase 2: when you are comfortable with phase 1 and some music analysis and can break down the progressions take some new songs or some songs you've already worked and write new fresh leads with out paying any attention to what was done. simply break down the rhythm section find the key pick a scale or two to use and let it rip.

Also you may need to work your "lick library" and build on the phrasing you do already when soloing to give you more ideas and options as well as some scale work.