sergbot 0 Share Posted December 6, 2020 10:49:20 PM: [SCRIPT] regular walk + timer reset(1862, 3536, 0) (1862, 3536, 0) log("regular walk + timer reset" + CrabSpot + " " + getLocalPlayer().getTile()); new CrabSpot = new Tile (1862, 3536); So I was using != operator to see if i was standing in the correct tile. And as you can see the crabspot and local.gettile, both were returning the same exact coordinate. However the code was supposed to only execute if they weren't equal, so the client kept thinking they weren't equal, but they are actually equal as you can see in the log. Link to comment Share on other sites More sharing options...
TheCloakdOne 389 Share Posted December 6, 2020 new CrabSpot = new Tile(1862,3536,0); shoul work From your console log you can see the tiles are initialized with a Z axis whereas CrabSpot isnt Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted December 6, 2020 5 hours ago, sergbot said: 10:49:20 PM: [SCRIPT] regular walk + timer reset(1862, 3536, 0) (1862, 3536, 0) log("regular walk + timer reset" + CrabSpot + " " + getLocalPlayer().getTile()); new CrabSpot = new Tile (1862, 3536); So I was using != operator to see if i was standing in the correct tile. And as you can see the crabspot and local.gettile, both were returning the same exact coordinate. However the code was supposed to only execute if they weren't equal, so the client kept thinking they weren't equal, but they are actually equal as you can see in the log. You need to use .equals() to compare objects. If you use != or == you are comparing the object references (which is not what you want) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.