Jump to content

How do I use the Player methods?


Recommended Posts

Posted (edited)
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

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...