Making event.phase == "ended"

Hello! Is it possible to make an event.phase == “ended” like this…

if scores:retrieve("player1") == 5 then  
 somefunction event.phase == "ended"  
end  

Thanks [import]uid: 39302 topic_id: 24592 reply_id: 324592[/import]