Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   putnpc2, remove? (https://forums.graalonline.com/forums/showthread.php?t=134264177)

Adddeeee 08-11-2011 06:52 PM

putnpc2, remove?
 
Hi!

When using putnpc2; how do I remove the npcs after creating them?

I used this.destroy(), but it seems as if they are still there. Sometimes their onPlayerTouchsMe fires, even though they are not there graphically. I guess I didn't delete them properly?

xAndrewx 08-11-2011 06:54 PM

You can

HTML Code:

/clearnpcs levelnamehere.nw
to delete all putnpc2 NPCs in the level

fowlplay4 08-11-2011 07:00 PM

I've also put code in the server-side that lets me chat to destroy it. I.e:

PHP Code:

function onPlayerChats() {
  if (
player.account == "fowlplay4") {
    if (
player.chat == "/destroy") {
      
destroy();
    }
  }


clearnpcs lets you remove all putnpc2 npcs in the level though.

Adddeeee 08-11-2011 07:06 PM

So this.destroy erases them completely?

xAndrewx 08-11-2011 07:19 PM

yes

Twinny 08-11-2011 09:18 PM

Just make sure you do this.destoy(); serverside.


All times are GMT +2. The time now is 12:25 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.