Jump to content

(HELP) Scouting Bot


Recommended Posts

Posted (edited)

Here is an example where I've done something similar to what you're asking. This just gets the closest player to your character (that is not your character). 

 

        Players players = api.getPlayers();

        if (players != null) {
            // get the closest player that is not the script users character
            closest_player = players.closest((p) -> p.getId() != api.myPlayer().getId());
            if (closest_player != null) {
                // do w/e with closest player

            }
        }

 

Edited by bugsinmycode
  • Like 1
Posted
3 minutes ago, bugsinmycode said:

Here is an example where I've done something similar to what you're asking. This just gets the closest player to your character (that is not your character). 

 


        Players players = api.getPlayers();

        if (players != null) {
            // get the closest player that is not the script users character
            closest_player = players.closest((p) -> p.getId() != api.myPlayer().getId());
            if (closest_player != null) {
                // do w/e with closest player

            }
        }

 

Thank you very much sir. :) very new with the API

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...