I played basketball my knee felt really tight in the back I have complete motion of it but it still hurts when I bend it it buckles on me whatswrong?

Difficult to say, . But the symptoms u are describing could be caused by a ' strained' hamstring muscle/ tendon.Try ice for 24 hrs, a NSAID and rest( from activities which aggravate your pain).If it continues have your parent(s) contact a physician so you can be examined .Good luck!
Observe , consult. I'd bike , walk observe for 7-10 days. If still still tight, painful and wobbly then orthopedic evaluation. Could be mild like tendon strain but possible internal damage may have occcured ( meniscus/ ligament). Be safe and evaluate if symptoms persist.