View Single Post
  #1  
Old 01-04-2014, 02:08 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
NPC checking for player

As you all know, the onPlayerTouchsMe() only works if the player runs into the NPC.

How would I script the NPC to check if the player is in the x, y of the object.
In this case, block.png

PHP Code:
function onCreated(){
 
setImg("block.png");
 
setTimer(1);
}

function 
onTimeOut(){
 
destroy();
}

function 
onPlayerTouchsMe(){
 
player.chat "HIT";

Reply With Quote