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
Games Random Rezzer Game  

Random Rezzer Game

Random rezzer

Category: Games
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life

the Zip file

Download all files for Random Rezzer Game
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Prim Script.lsl
Get file # 2. Rezzer.lsl
Get file # 3. Scorekeeper.lsl
1
2 integer channel = -1234321; // some random integer rto talk with
3
4
5 default
6 {
8 {
9 llSetStatus(STATUS_PHYSICS,TRUE); // make it bouncy
10 llSetStatus(STATUS_RETURN_AT_EDGE,TRUE) ; // be nice to neighboring parcels
11 }
12
13 timer()
14 {
15 llWhisper(0,"No one grabbed the " + llGetObjectName());
16 llDie(); /// Aww, another wasted prim
17 }
18
19 // if they touch this, the name is snt to the HUD
20 touch_start(integer total_number)
21 {
22 llShout(channel, llDetectedName(0) + "^" + (string) llDetectedKey(0) );
23 llDie();
24 }
25
26 // the rezzer sends a '1' as a start_param, so we can tell this prim to die. Otherwise it will die when you rez it to work on it.
27 on_rez(integer start_param)
28 {
29 if(start_param)
30 {
31 llSetTimerEvent(llFrand(10) + 5); // object will be here for 5 to 15 seconds, then die
32 }
33 }
34
35 }

Random Rezzer Game

Random Rezzer

Category: Games
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life

1
2 // Put objects in this box and it will rez them at various speeds and places.
3 // Make sure the boxes are physical and temporary or you will quickly have a pile of prims
4
5 default
6 {
7 on_rez(integer start_param)
8 {
9 llResetScript(); // when you rez it, we have to start a listener
10 }
12 {
13 llSetTimerEvent(1); // rez in 1 second at startup.
14 }
15 timer() {
16
17 integer howmany = llGetInventoryNumber(INVENTORY_OBJECT); // how many items, 1,2,3
18
19 integer whichone = llCeil(llFrand(howmany)) -1 ; // pick one at random
20 string name = llGetInventoryName(INVENTORY_OBJECT,whichone); // get the name of the object
21 llSay(0, "Now in play: "+ name);
22 float x = llFrand(9) + 1; // up to a MAXIMUM of 10 meters away, no closer than 1 meter away. Cannot rez furrhaer than 10
23 float y = llFrand(9) + 1; // up to a MAXIMUM of 10 meters away, no closer than 1 meter away. Cannot rez furrhaer than 10
24 float pushx = llFrand(1); // Give it a velocity
25 float pushy = llFrand(1); // Give it a velocity
26 vector pos = llGetPos();
27 float z = pos.z;
28 pos.x += x; // add the current position to the random rez place
29 pos.y += y; // add the current position to the random rez place
30
31
32 llRezObject( name,pos,<pushx,pushy,0>,ZERO_ROTATION,1); // rez an object at random location and speeds at 1 meter height so it bounces
33 llSetTimerEvent(llFrand(20) + 10); // rez from 10 to 30 seconds, randomly
34 }
35 }

Random Rezzer Game

random game

Category: Games
By : Anonymous
Created: 2013-09-06 Edited: 2013-09-04
Worlds: Second Life

1
2 integer GIVE = TRUE; // if TRUE, give them a random prize
3
4 integer channel = -1234321; // some random integer rto talk with
5 integer maxCount = 100; // Only keep the 100 top scores so we do not run out of RAM
6 list scores;// a list of scores (integers like 1,1,23, and avatar names. Wr number is first so we can sort on it for high scores.
7
8 default
9 {
10 on_rez(integer start_param)
11 {
12 llResetScript(); // when you rez it, we have to start a listener
13 }
14
16 {
17 llListen(channel,"","",""); // listen on our secret channel for things that are touched.
18 }
19
20 listen(integer channel, string name, key id, string message)
21 {
22
23 list stuff = llParseString2List(message,["^"],[]); // look in message for aviName^aviKey
24 string aviName = llList2String(stuff,0); // get the name
25 key aviKey = (key) llList2String(stuff,1); // get the key
26 llSay(0, "Prim " + name + " caught by : " + aviName);
27
28 // lets see of this person is in the list of people already played
29 integer index = llListFindList(scores,[aviName]); // get the number of the position of the name, the score is one less than this
30 if(index == -1)
31 {
32 // Nope, so we add them to the list
33 scores += 1; // they have one object;
34 scores += aviName;
35 llOwnerSay("Welcome, " + aviName + " . This you your first time to play, so just keep watching for and clicking the objects and have fun");
36 }
37 else
38 {
39 // yes, they have played before, get their old score
40 integer oldscore = llList2Integer(scores,index-1);
41 oldscore++; // add an object to the old score
42 scores = llListReplaceList(scores,[oldscore],index-1, index-1); // save it back in the score list
43 }
44
45 if(GIVE)
46 {
47 integer PrizeNum = llGetInventoryNumber(INVENTORY_OBJECT); // get how many items are in this prim
48 integer whichOne = llCeil(llFrand(PrizeNum)) -1 ; //pick a prize, randomly
50 }
51
52
53
54 scores = llListSort(scores,2,FALSE); //sort from largest num to lowest
55
56 scores = llDeleteSubList(scores, maxCount, maxCount+1); // delete the smallest score so we never get bigger than maxCount
57
58 string scoreText; // We need to calculate the highest scores for display
59 integer i ;
60 integer stop = 10; // show top 10 scores
61 if(llGetListLength(scores) < 10) // is the list bigger than 10 yet?
62 {
63 stop = llGetListLength(scores);
64 }
65
66 // print out the top 10 scores, or fewer
67 for (i = 0; i < stop; i+= 2)
68 {
69 scoreText += llList2String(scores,i+1) + " : " + (string) llList2String(scores, i) + "\n";
70 }
71 llSetText(scoreText,<1,1,1>,1.0);
72 llOwnerSay(scoreText);
73
74
75 }// end listen
76 } // end default

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