Clicking & waiting for an input?

Discussion in 'Plugin Development' started by TopGear93, Jan 20, 2013.

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

    TopGear93

    How would I make it so that when a player clicks a block they need to input a string within X amount of time?
     
  2. Offline

    CubixCoders

    HashMap,
    public Map<String, Long> time = new HashMap<String, Long>();
    WHen they click the block add them
    time.put(player.getName(), System.currentTimeMillis() + 10); (10 seconds)
    When they send the message,
    if(time.contains(player.getName())){
    if(time.get(player.getName()) <= System.currentTimeMillis()){}
    }
     
    TopGear93 likes this.
  3. Offline

    TopGear93

    Thanks for the help. Ill try to work with and see where I get :D.
     
  4. Offline

    CubixCoders

    time.put(player.getName(), System.currentTimeMillis() + (10 * 1000)); (10 seconds)
     
Thread Status:
Not open for further replies.

Share This Page