Thread: Ranging Problem

Results 1 to 6 of 6
  1. #1 Ranging Problem 
    Glowingbull
    Guest
    Anytime I wield a bow and attack some (NPC or player) it won't attack from far away, it always walks up to the NPC or player then starts attacking. How can I make it attack from far away like a ranged weapon is supposed to?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Xynth's Avatar
    Join Date
    May 2009
    Posts
    2,222
    Thanks given
    226
    Thanks received
    259
    Rep Power
    1155
    Hmm, try this..
    Code:
    				if(GoodDistance(playerTargetX, playerTargetY, absX, absY, 6) == false) {
    					followID = AttackingOn2.playerId;
    				}
    				if (GoodDistance(playerTargetX, playerTargetY, absX, absY, 6) == true) {
    					followID = 0;
    					walkTo(0,0);
    				}
    Sorry if I am wrong.
    Reply With Quote  
     

  3. #3  
    Glowingbull
    Guest
    This probably sounds really stupid but uh... Where do I put it?
    and thank you for helping me
    Reply With Quote  
     

  4. #4  
    Registered Member
    Xynth's Avatar
    Join Date
    May 2009
    Posts
    2,222
    Thanks given
    226
    Thanks received
    259
    Rep Power
    1155
    boolean attack() IDK if it will work.. It's just an idea.
    Reply With Quote  
     

  5. #5  
    Glowingbull
    Guest
    I put it there and I got 7 errors.

    client.java: cannot find symbol
    symbol : variable playerTargetX
    location: class client
    If (GoodDistance (playerTargetX, playerTargetY, absX,absY 6) == false) { ^

    They all are pretty similar to that. Any idea how to fix it?
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Nov 2007
    Age
    28
    Posts
    644
    Thanks given
    7
    Thanks received
    6
    Rep Power
    104
    Quote Originally Posted by Glowingbull View Post
    I put it there and I got 7 errors.

    client.java: cannot find symbol
    symbol : variable playerTargetX
    location: class client
    If (GoodDistance (playerTargetX, playerTargetY, absX,absY 6) == false) { ^

    They all are pretty similar to that. Any idea how to fix it?
    They are common java errors, google or actually learning java (read a textbook, online or at a library) can help you
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •