Follow us on Twitter
Digital Concepts Website!

Npc Follower v0.1

OS Windows Linux Macintosh Mode Standalone Grid Simian Grid Diva Grid Compat Aurora-Sim Langage Ossl
  • Titre
    Npc Follower v0.1
  • Createur
    djphil
  • Gratuit
    Oui
  • Page vues
    3672 fois
  • Favoris
    Ajouter aux favoris
  • J'aime
  • Voter
    (0 votes)

Voici un petit script simple pour qu'un bot npc  vous suive.

Les fonctions NPC n'étant pas implémentées dans Aurora-Sim, ces scripts ne fonctionneront donc pas sur ce type de server. Heureusement sur Aurora-Sim nous avons les BotFunctions (exclusives).
Npc Follower v0.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Npc Follower v0.1
 
key npc;
vector toucherPos;
vector npcPos;
vector MasterPos;
rotation MasterRot;
key masterKey;
string ObjectName;
vector Separator = <2, 2, 0>;
 
default
{
 state_entry()
 {
 llSetText("NPC DEMO v0.1\nCliquez moi!",<1,1,1>, 1.0);
 ObjectName = llGetScriptName();
 llSetObjectName(ObjectName);
 }
 
 touch_start(integer number)
 {
 npcPos = llGetPos() + <(integer)llFrand(3),(integer)llFrand(3),0>;
 
 osAgentSaveAppearance(llDetectedKey(0),llKey2Name(llDetectedKey(0)));
 
 list user = llParseString2List(llKey2Name(llGetOwner()), [" "], []); 
 string First = llList2String(user, 0);
 string Last = llList2String(user, 1);
 npc = osNpcCreate(First,Last, npcPos,llKey2Name(llDetectedKey(0)));
 toucherPos = llDetectedPos(0);
 
 osNpcMoveTo(npc, toucherPos + <(integer)llFrand(3),(integer)llFrand(3),0>);
 osNpcSay(npc, "Hello! Mon nom est " + llKey2Name(npc));
 state follow;
 }
}
 
state follow
{
 state_entry()
 {
 masterKey = llGetOwner();
 llSensorRepeat("",masterKey,AGENT,96.0,PI,1.0);
 llSetText("NPC DEMO v0.1\nReady to Follow!",<1,1,1>, 1.0);
 }
 
 sensor(integer num_detected)
 {
 MasterPos = llDetectedPos(0);
 MasterRot = llDetectedRot(0);
 
 osNpcMoveToTarget(npc,MasterPos-Separator,OS_NPC_NO_FLY);
 osNpcSetRot(npc,MasterRot);
 }
 
 touch_start(integer number)
 {
 osNpcSay(npc, "Goodbye!");
 osNpcRemove(npc);
 npc = NULL_KEY;
 state default;
 }
}