With these codes

public boolean rogue()	{
	if(rogue = true)
	{
		playerEquipment[playerHat]=5554; // set armor
		playerEquipment[playerCape]=6570;
		playerEquipment[playerAmulet]=6585;
		playerEquipment[playerChest]=1;
		playerEquipment[playerShield]=1;
		playerEquipment[playerLegs]=5555;
		playerEquipment[playerHands]=5556;
		playerEquipment[playerFeet]=5557;
		playerEquipment[playerRing]=1;
		playerEquipment[playerArrows]=1;
		playerEquipment[playerWeapon]=1;
}
}
public booletan hunter()	{
	if(hunter = true)
	{
		playerEquipment[playerHat]=1038; // set armor
		playerEquipment[playerCape]=6570;
		playerEquipment[playerAmulet]=6585;
		playerEquipment[playerChest]=-1;
		playerEquipment[playerShield]=-1;
		playerEquipment[playerLegs]=-1;
		playerEquipment[playerHands]=7462;
		playerEquipment[playerFeet]=-1;
		playerEquipment[playerRing]=6735;
		playerEquipment[playerArrows]=-1;
		playerEquipment[playerWeapon]=4151;
}
}

Which will set the player's armor/weapons to the id's on the right, -1 = None.
Idk if you needed that info or not, but oh well.

I get missing return statement twice, i tryed adding return false, return true, return 0, before the 2 "}"s still the same error. Please help? Thanks!

Recommended Answers

All 4 Replies

Your return statement needs to be in between the two brackets

}  
// return statement with what you want it to return
}

It needs to be in between because if you put it before it is still in the loop and if the conditions are not met it will not run the return secondly it need to be before the end of the method.

What do u mean by what i want it to return with? i just want it to end - what would i put ?
return = 0; ? and thanks for the help :)

chk the if condition
it must be if(rogue==true)
{...}


With these codes

public boolean rogue()	{
	if(rogue = true)
	{
		playerEquipment[playerHat]=5554; // set armor
		playerEquipment[playerCape]=6570;
		playerEquipment[playerAmulet]=6585;
		playerEquipment[playerChest]=1;
		playerEquipment[playerShield]=1;
		playerEquipment[playerLegs]=5555;
		playerEquipment[playerHands]=5556;
		playerEquipment[playerFeet]=5557;
		playerEquipment[playerRing]=1;
		playerEquipment[playerArrows]=1;
		playerEquipment[playerWeapon]=1;
}
}
public booletan hunter()	{
	if(hunter = true)
	{
		playerEquipment[playerHat]=1038; // set armor
		playerEquipment[playerCape]=6570;
		playerEquipment[playerAmulet]=6585;
		playerEquipment[playerChest]=-1;
		playerEquipment[playerShield]=-1;
		playerEquipment[playerLegs]=-1;
		playerEquipment[playerHands]=7462;
		playerEquipment[playerFeet]=-1;
		playerEquipment[playerRing]=6735;
		playerEquipment[playerArrows]=-1;
		playerEquipment[playerWeapon]=4151;
}
}

Which will set the player's armor/weapons to the id's on the right, -1 = None.
Idk if you needed that info or not, but oh well.

I get missing return statement twice, i tryed adding return false, return true, return 0, before the 2 "}"s still the same error. Please help? Thanks!

commented: Good catch, I missed that +7

You spelled boolean wrong in your if statement for hunter(). If you don't want to return anything than why not make it

public void hunter(){

}

Lastly do what abdulraqeeb33 said.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.