Jump to content

How do I use the Player methods?


mitsuki

Recommended Posts

1 hour ago, mitsuki said:

How do I use the methods for: Player?

I've tried using things like:



boolean enemyPlayer = Player().getSkullIcon();
int enemyCombatLvl = Player().getCombatLevel();

But I keep getting: Method call expected.

 

Anyone know what I'm doing wrong?

 

 

You are calling the Player class. To use methods that are within that class you must first set a Player variable. Also getSkullIcon() does not return a boolean value, it returns an integer.

 

Player player = getPlayers().closest("Bob");

Then once you have set the Player variable you can than call those methods.

Player player = getPlayers().closest("Bob");
if (player != null) {
    int enemyPlayerSkullIcon = player.getSkullIcon();
    int enemyCombatLevel = player.getCombatLevel();
}
Edited by BravoTaco
  • Like 1
  • Boge 1
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...