Set Global Variable: Invincible = 0
After collision with enemy, set Invincible = 1
Wait 3 seconds (or how many second you wish for your player to be invincible)
Set Invincible = 0
If invincible = 1 then do not make dmg to player (you need to get this into the part of the code where player takes dmg)
If you have the part where: player collides with enemy event, add another event: Invincible =0
So it would be: if player collides with enemy and invincible =0 -----> player takes damage
Or you could use true/false instead of 1/0.