View Single Post
  #1  
Old 05-28-2012, 12:42 AM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
NPC range check/Place NPC

question 1

Let's say I have a NPC on a looping TimeOut(). What is the code to check to see if a player is near by? I think it would go SOMETHING like this.

PHP Code:
funtion onTimeOut()
{
 if (
player.<= this.+10)
  {
    if (
this.player.-10)
     {
       
//what ever i want it to do//
       
setTimer(1); 
That's not right but i suck at math

Question 2

I am a little confused on the placeNpc function.
How do I place a NPC that joins a certain class?
Reply With Quote