Cant wrap my head around how to do this

Hey!

Say I have a game with 30 levels each level is on a different frame.

Once completing a level you get a star. How can I set this up so if you complete the same level twice you do NOT get two stars?

Thanks