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 A_speedclick_game  

A_speedclick_game

Speed Click Game

Category: Games
By : Nitsuj Kidd
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for A_speedclick_game
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. A_speedclick_game_by_Nitsuj_Kidd_1.lsl
1 //A simple clicking game.
2 //By TSL Resident: Nitsuj Kidd
3 txt(string what)
4 {
5 llSetText(what,<1,1,1>,1);
6 }
7 integer minus(integer one,integer two)
8 {
9 return one - two;
10 }
11 key bist;
12 string playur;
13 key winner;
14 integer clicks;
15 key player;
16 integer time;
17 //////////////////////////////////////////////////////CLICKS///////////////////////////////////////////////////////////////////////////////
18 integer high = 50;
19 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
20 string best = "Mr. Nobody";
21 default
22 {
24 {
25 txt("Requesting permissions...");
28 }
30 {
31 if(c && CHANGED_OWNER)
32 {
34 }
35 }
37 {
39 }
41 {
43 {
44 state active;
45 }
46 else
47 {
49 }
50 }
51 }
52 state active
53 {
55 {
56 llSetTouchText("Click!");
57 txt("The clicking game\n Pay me 1L$ to play\nBest: "+best+" - Clicks: "+(string)high);
58 }
59 money(key giver, integer ammount)
60 {
61
62 if(ammount == 1)
63 {
64 time = 0;
65 txt("The clicking game\n Current player: " + llKey2Name(giver));
66 player = giver;
68 clicks = 0;
69 }
70 if(ammount > 1)
71 {
72 integer change = minus(ammount,1);
73 llGiveMoney(giver,change);
74 }
75 }
76 touch_start(integer total_number)
77 {
78 if(llDetectedKey(0) == player)
79 {
80 playur = llKey2Name(player);
81 clicks++;
82 txt("The clicking game\n\n Current player: " + llKey2Name(player) + "\n Clicks: " + (string)clicks);
83 }
84 }
85 timer()
86 {
87 {
88 state check;
89 }
90 }
91 }
92 state check
93 {
95 {
96 txt("Game over!\n " + playur + " had " + (string)clicks + " clicks!");
97 player = NULL_KEY;
98 llSleep(2);
100 if(clicks>high)
101 {
102 txt("You got the best score!");
103 llSleep(2);
104 high = clicks;
105 best = playur;
106 bist = player;
107 player = "";
108 state active;
109 }
110 else
111 {
112 txt("You didn't get the high score!");
113 llSleep(2);
114 state active;
115 }
116 player = "";
117 clicks = 0;
118 }
119 }

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