Jump to content

(HELP) Scouting Bot


averagee

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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