Thread: triggeraction
View Single Post
  #6  
Old 05-09-2010, 10:51 AM
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
Quote:
Originally Posted by cbk1994 View Post
You can also do

PHP Code:
function onCreated() {
  
this.level.tapThis this;
}

function 
onPow() {
  
this.chat "ouch!";
}

//#CLIENTSIDE
function onPlayerChats() {
  
triggerServer("npc""TriggerControl""Trigger"this.level.name"tapThis""Pow");

and then in an NPC TriggerControl

PHP Code:
function onActionTrigger(levelNamenpcNamecommand) {
  
findLevel(levelName).(@ npcName).trigger(command);

Though you'd want to add some security features. Usually something like this is preferable since you never know if a trigger will be received when using x/y.


That's a good idea =o


I made an NPC with an image / setshape, once I sent the triggeraction it found it the first time, I changed the image to "no-shield.png" (an image with nothing in it) and I tried to send the triggeraction again and it wouldn't work.
I've fixed the problem now by using showimg() (thanks to salesman) but this needs to be fixed, I assumed it was because of this.
__________________
Reply With Quote