Jump to content
  • 0
Sign in to follow this  
yancey112

having troubles with stopping public void run() {

Question

if (getEquipment().getRingId() == 1337
&& getHitpoints() <= getMaxHitpoints() * 0.90) {// priority
WorldTasksManager.schedule(new WorldTask() {
int count = 1;

@Override
public void run() {
if (count == 0)
stop();
getPackets()
.sendGameMessage(
"Your hammer heals you 100 lifepoints.");
count--;
}
}, 0, 5);
}



i have it in player.java but it just spam heals so is there a way i could make it stop and then check back through to see if players hp is below 90%? sorry its very hard to explain but i tried my best hope you understand thank you!

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
You really need to learn the basic operators that are in the java language. Maybe this would help with your problem [url]http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html[/url] . If you are programming you should really have good logical math skills. I am not going to spoon feed you though as you [b]need[/b] to learn how to do this stuff on your own. I'll give you a hint you are calculating the health wrong aswell as using the wrong operators. You also did the event incorrectly so I would check on that aswell. Edited by jediz

Share this post


Link to post
Share on other sites
  • 0
lol i only posted half of my code cause this aint a snippet section lol and how is telling me how to stop one thing "spoon feeding" please explain.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×