Solved How to play a effect when a count down is going?

Discussion in 'Plugin Development' started by FuZioN720, Jun 28, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    FuZioN720

    Hello, is there a way i can get all the player on the server and play a effect at their location but i only want the effect to play ever message the countdown gives out.
    For example I want an effect/sound to be heard by everyone every time the Countdown says like "5 Minutes Left"

    Here is my Countdown code:
    Code:java
    1.  
    2. public void CountDown(){
    3. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask((Plugin) this, new Runnable(){
    4. @Override
    5. public void run(){
    6. final int minutes = Count / 60;
    7. if (Count % 60 == 0 && Count > 60){
    8. Bukkit.broadcastMessage(prefix + "THE WALL WILL FALL IN " + minutes + " MINUTES!");
    9. }
    10. else if (Count == 60){
    11. Bukkit.broadcastMessage(prefix + "THE WALL WILL FALL IN " + minutes + " MINUTE!");
    12. }
    13. else if (Count == 30){
    14. Bukkit.broadcastMessage(prefix + "THE WALL WILL FALL IN " + Count + " SECONDS!");
    15. }
    16. else if (Count == 15){
    17. Bukkit.broadcastMessage(prefix + "THE WALL WILL FALL IN " + Count + " SECONDS!");
    18. }
    19. else if (Count < 11 && Count > 0){
    20. Bukkit.broadcastMessage(prefix + "THE WALL WILL FALL IN " + Count + " SECONDS!");
    21. }
    22. else if (Count == 0){
    23.  
    24. }
    25. Count--;
    26. }
    27. },0L, 20L);
    28. }
    29.  


    When i was doing research some people look like they tried to send a packet but that's not working for me.
     
  2. Offline

    Rprrr

    Pseudo, real quick.

    Code:
    for player onlineplayer : bukkit.getOnlineplayersstuff {
        onlineplayer.playSound(onlinePlayer.getLocation(), sound st00f over here);
        onlinePlayer.getWorld().playEffect(onlinePlayer.getLocation(), effect st00f over here);
    }
     
    FuZioN720 likes this.
  3. Offline

    FuZioN720

    Rprrr Thanks So Much
     
Thread Status:
Not open for further replies.

Share This Page