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
Rezzers random_item_rezzer  

random_item_rezzer

you can have tons of fun with this if you fool with it

Category: Rezzers
By : Martin
Created: 2010-06-27 Edited: 2010-06-27
Worlds: Second Life

the Zip file

Download all files for random_item_rezzer
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. random_item_rezzer_1.lsl
1 string object = "ball"; // Name of object in inventory
2 string object1 = "square";
3 string object2 = "triangle";
4 string object3 = "cylinder";
5
6 vector relativePosOffset = <0.5, 0., 2.0>; // "Forward" and a little "above" this prim
7 vector relativeVel = <0.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/s
8 rotation relativeRot = <0.0, 0.0, 0.0, 0.0>; // Rotated 90 degrees on the x-axis compared to this prim
9 integer startParam = 10;
10
11
12 default
13 {
15 {
16
17 }
18
19 touch_start(integer total_number)
20 {
21 float FloatValue;
22 integer IntValue;
23 string StringValue;
24
25 FloatValue = llFrand(3);
26 IntValue = llRound(FloatValue);
27 StringValue = (string)IntValue;
28
29 if(StringValue == "0")
30 {
31 vector myPos = llGetPos();
32 rotation myRot = llGetRot();
33
34 vector rezPos = myPos+relativePosOffset*myRot;
35 vector rezVel = relativeVel*myRot;
36 rotation rezRot = relativeRot*myRot;
37
38 llRezObject(object, rezPos, rezVel, rezRot, startParam);
39 }
40
41
42 if(StringValue == "1")
43 {
44 vector myPos = llGetPos();
45 rotation myRot = llGetRot();
46
47 vector rezPos = myPos+relativePosOffset*myRot;
48 vector rezVel = relativeVel*myRot;
49 rotation rezRot = relativeRot*myRot;
50
51 llRezObject(object1, rezPos, rezVel, rezRot, startParam);}
52
53 if(StringValue == "2")
54 {
55 vector myPos = llGetPos();
56 rotation myRot = llGetRot();
57
58 vector rezPos = myPos+relativePosOffset*myRot;
59 vector rezVel = relativeVel*myRot;
60 rotation rezRot = relativeRot*myRot;
61
62 llRezObject(object2, rezPos, rezVel, rezRot, startParam);
63
64 }
65
66 if(StringValue == "3")
67 {
68 vector myPos = llGetPos();
69 rotation myRot = llGetRot();
70
71 vector rezPos = myPos+relativePosOffset*myRot;
72 vector rezVel = relativeVel*myRot;
73 rotation rezRot = relativeRot*myRot;
74
75 llRezObject(object3, rezPos, rezVel, rezRot, startParam);
76
77 }}
78 }

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