I need help with a code so that when a character picks up a coin it has a stund effect on enemies specifically zombies I would really like help
![Twitter](/assets/twitter-4e19209ef84344ee0c433f4c7bad8d49.png)
![Twitter.hover](/assets/twitter.hover-1fb19a5bafc50deace8f88eaec867845.png)
public int stunTimer = 0; public void act() { if (stunTimer > 0 && --stunTimer > 0) return; // current code in act method here }
for (Object obj : getWorld().getObjects(Zombie.class)) { ((Zombie)obj).stunTimer = 300; // 5-seconds of stun time (approx. 60 acts per second) }