Originally Posted by
ofek123411
Can you post the code for that "one" and "two" commands
Here is some of the code:
Code:
final carpetData data = carpetData.values()[carpetRide];
player.running = false;
PathFinder.path(player, data.startPosition.getX(), data.startPosition.getY());
Server.getTaskScheduler().schedule(new Task(1, false) {
@Override
public void execute() {
if(player.getPosition().equals(data.startPosition)) {
//TODO: add facing based on dir
player.facePosition(player.getPosition().getX(), player.getPosition().getY() - 1);
Server.getTaskScheduler().schedule(new Task(2, false) {
@Override
public void execute() {
player.running = true;
//Sets the players running/stand/turning animations to the onces from the carpet
handleSetup(player);
stop();
}
});
Server.getTaskScheduler().schedule(new Task(3, false) {
@Override
public void execute() {
if(player.index == -1) {
stop();
return;
}
//So if "pathRequired" is true it will run/walk the player to the next path
if(player.pathRequired) {
PathFinder.path(player, data.walkTo[player.carpetStage].getX(), data.walkTo[player.carpetStage].getY());
player.pathRequired = false;
}
//Rest is pointless
}
});
stop();
}
}
});
}