You'll get a lot better help if you try to achieve it yourself. This way, not only will you learn what not to do, but we'll know what you have already tried when you tell us what you have tried already.
Also, posting a capx or at the least a screenshot of the events. Sorry, but you'll find that no one is going to write the logic for you. Try, try and then try again.
Again, if we don't know what you have done, tried, and/or failed on, we can't help.