Friday, November 21, 2008
USERLOGIN PASSWORD Remember?
You are here » Learning Center ยป Forums

Openlife Forums

 Openlife Grid Forums
Minimize
 
  Openlife Forums  Scripting  Openlife LSL Ex...  Basic NPC script
Previous Previous
 
Next Next
New Post 8/23/2008 7:36 AM
User is offline Stefan
5 posts
Openlife Newbie


Basic NPC script 
Tryed it, worked ingame.
Very basic but its ok.
[code]
integer hp = 1000;
default {
state_entry()
{
llSetText("Filthy Creature Health:"+(string)hp, <1,0,0>, 1.0);
hp = 1000;
}
sensor(integer total_number)
{
llSetPos(llDetectedPos(0));
}
collision(integer num_detected) {
hp -= 10;
llSetText("Filthy Creature Health:"+(string)hp, <1,0,0>, 1.0);
llSetTimerEvent(2.0);
if(hp == 0)
{
llSay(0,"Ill get you for this "+llDetectedName(0)+"!");
llDie();
}
}
timer()
{
llSensor("", NULL_KEY, AGENT, 10, PI);
}
}
[/code]
 
New Post 8/24/2008 4:54 AM
User is offline Pratyeka Muromachi
235 posts
Openlife Rising Star




Re: Basic NPC script 

What is it for? What does it do?


Meditating Avatar Gone for a walk.
 
New Post 8/24/2008 5:20 AM
User is offline Stefan
5 posts
Openlife Newbie


Re: Basic NPC script 
 Pratyeka Muromachi wrote

What is it for? What does it do?

Basicly, it just sit's around. When a avatar comes within 10 meter it attacks it by going towards that avatar holding 1M distance, it has hp defined above in the script. When you end colliding with it it loses some HP when it dies ti says Ill get you for this aviname!
 
New Post 8/24/2008 3:14 PM
User is offline Pratyeka Muromachi
235 posts
Openlife Rising Star




Re: Basic NPC script 

Ah cool! thanks for the info.


Meditating Avatar Gone for a walk.
 
Previous Previous
 
Next Next
  Openlife Forums  Scripting  Openlife LSL Ex...  Basic NPC script
 Popular Forum Threads
Minimize
In the past 1 week, we have 65 new thread(s) and 256 new post(s)
The most popular thread has been GLBT Region?
The most active thread has been GLBT Region?
Privacy Statement | Terms Of UseAll Rights Reserved 2007,2008 3DX - Openlifegrid.com