NPC's not staying on restart.
Hey guys. I'm building up a server, because I really just want to host one, and it's an awesome chance for me to get my Java skills more advanced, but I am having a trouble with my NPC's in the Free Market.
I'm trying to put them in the Free Market just as a quick go-to for members, but after I restart the server, the NPC's disappear completely.
If anyone can help me fix this problem, and make them stay permanently, that will be amazing.
Re: NPC's not staying on restart.
Are you trying to use the !pnpc code or something like that to spawn them?
Re: NPC's not staying on restart.
I'm using the !npc command.
Code:
if (sub[0].equals("npc")) {
MapleNPC npc = MapleLifeFactory.getNPC(Integer.parseInt(sub[1]));
if (npc != null) {
npc.setPosition(player.getPosition());
npc.setCy(player.getPosition().y);
npc.setRx0(player.getPosition().x + 50);
npc.setRx1(player.getPosition().x - 50);
npc.setFh(player.getMap().getFootholds().findBelow(c.getPlayer().getPosition()).getId());
player.getMap().addMapObject(npc);
player.getMap().broadcastMessage(MaplePacketCreator.spawnNPC(npc));
}
Is the code for the command.
Re: NPC's not staying on restart.
Quote:
Originally Posted by
vampiricx3
I'm using the !npc command.
Code:
if (sub[0].equals("npc")) {
MapleNPC npc = MapleLifeFactory.getNPC(Integer.parseInt(sub[1]));
if (npc != null) {
npc.setPosition(player.getPosition());
npc.setCy(player.getPosition().y);
npc.setRx0(player.getPosition().x + 50);
npc.setRx1(player.getPosition().x - 50);
npc.setFh(player.getMap().getFootholds().findBelow(c.getPlayer().getPosition()).getId());
player.getMap().addMapObject(npc);
player.getMap().broadcastMessage(MaplePacketCreator.spawnNPC(npc));
}
Is the code for the command.
Use !pnpc