Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-11-2011, 06:52 PM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
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?
Reply With Quote
  #2  
Old 08-11-2011, 06:54 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
You can

HTML Code:
/clearnpcs levelnamehere.nw
to delete all putnpc2 NPCs in the level
__________________

Last edited by xAndrewx; 08-11-2011 at 07:19 PM..
Reply With Quote
  #3  
Old 08-11-2011, 07:00 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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.
__________________
Quote:
Reply With Quote
  #4  
Old 08-11-2011, 07:06 PM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
So this.destroy erases them completely?
Reply With Quote
  #5  
Old 08-11-2011, 07:19 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
yes
__________________
Reply With Quote
  #6  
Old 08-11-2011, 09:18 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Just make sure you do this.destoy(); serverside.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:07 PM.


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