spawnNpc or spawnNewNpc forgot the method, its in NpcHandler
|
|
As stated in the title, how would I go about doing this? When I click an object make specific npcs spawn.
Base is Project insanity

spawnNpc or spawnNewNpc forgot the method, its in NpcHandler
Okay, go into your ClickObject class and add a case for the objectId you want to spawn an NPC on click. I'll show you how to make it so that the spawned NPC is attackable by the player who clicked the object.
I hope that this helped you. If there is anything wrong, just let me know and I will help you out.Code:case ####: try { Server.npcHandler.spawnNpc(c, NPCID, X Position, Y Position, 0, 0, 120, 7, 70, 70, false, false); } catch(Exception e) { e.printStackTrace(); } break;
Got that error -__-Code:src\server\model\players\packets\ClickObject.java:126: non-static method spawnNp c(server.model.players.Client,int,int,int,int,int,int,int,int,int,boolean,boolea n) cannot be referenced from a static context server.model.npcs.NPCHandler.spawnNpc(c, 73, 3233, 9324, 0, 0, 120, 7, 7 0, 70, false, false);
Okay, try this...
NPCHandler.java
Search For:
Change To:Code:public void spawnNpc(
Hopefully that doesn't fuck it up. I'm not really that great with all of this static stuff.Code:public static void spawnNpc(
Add the spawnNpc code again in the same case right below the previous spawn.
| « Emote delays | [PI] How do i delete teleports » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |