I need a code so that when a policeman collides with a coin he can create a temporary stun effect on enemies.
I'm new to programming and thanks in advance.


public static int stunTimer = 0;
stunTimer = 0;
if (stunTimer > 0) stunTimer--;
MyWorld.stunTimer = 180: // for 3 seconds of stun time
if (MyWorld.stunTimer > 0) return