Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Pet basic_follower__rotation  

basic_follower__rotation

basic follower + rotation.lsl

Category: Pet
By : Logan Bauer
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for basic_follower__rotation
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. basic_follower__rotation_1.lsl
1
2
3 ////////////////////////////////////////////////////////////////
4 // Open Basic Follower/Facing Script, by Logan Bauer. //
5 ////////////////////////////////////////////////////////////////
6 // OFFSET is the position of your pet in relation to it's owner's position.
7 // For example, in the default setting below, "vector offset =<-1,0,1>;"
8 // I.E. (x,y,z), the -1 puts it 1m back behind owner, the 0 means don't have
9 // it stay left or right, and 1 means have it stay 1m above it's owner.
10 // So, if you wanted the script to make it follow directly in front of you,
11 // and to the left, then you would change it to "vector offset =<1,1,0>;"
12
13
14 vector offset =<-1,0,1>;
15
16 startup()
17 {
18 vector pos = llGetPos();
19 llSetStatus(STATUS_ROTATE_Z,TRUE);
21 key id = llGetOwner();
23 llSensorRepeat("",llGetOwner(),AGENT,200,2*PI,.5);
24 }
25
26 default
27 {
29 {
30 startup();
31
32
33 }
34
35 on_rez(integer start_param)
36 {
37 startup();
38 }
39
40 sensor(integer total_number)
41 {
42 vector pos = llDetectedPos(0);
43 llMoveToTarget(pos+offset*llDetectedRot(0),.3);
44 llLookAt(pos, .1 , 1);
45 }
46 }
47
48 // END //

Back to the Best Free Tools in Second Life and OpenSim.