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
Money Chair Money_Chair  

Money_Chair

Money_Chair

Category: Money Chair
By : Davy Maltz
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Money_Chair
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Money_Chair_1.lsl
1 integer moneyamount = 4;
2 integer totaltime = 65;
3 integer secondspassed;
4 integer minutespassed;
5 string timepassed;
6 string timeleft;
7 key sitter;
8
9 default
10 {
11 on_rez(integer start_param)
12 {
14 }
16 {
17 llSitTarget(<0.5,0.0,0.5>,<0,0,0,0>);
18 llSetText("Earn L$4 Per 10 Minutes!",<0,1,0>,1.0);
20 }
22 {
23 if(perm)
24 {
25 llOwnerSay("Permission Granted.");
26 }
27 else
28 {
29 llOwnerSay("Must Grant Debit Permissions.");
31 }
32 }
33 changed(integer change)
34 {
35 sitter = llAvatarOnSitTarget();
36 if(sitter != NULL_KEY)
37 {
38 llSetTimerEvent(1.0);
39 }
40 else if(sitter == NULL_KEY)
41 {
42 llSetTimerEvent(0.0);
43 secondspassed = 0;
44 minutespassed= 0;
45 timepassed = "";
46 llSetText("Earn L$4 Per 10 Minutes!",<0,1,0>,1.0);
47 }
48 }
49
50 timer()
51 {
52 sitter = llAvatarOnSitTarget();
53 if(sitter != NULL_KEY)
54 {
55 secondspassed = secondspassed + 1;
56 minutespassed = secondspassed / 60;
57 timepassed = (string)minutespassed + ":" + (string)(secondspassed - (minutespassed * 60));
58 timeleft = (string)(secondspassed / 60) + ":" + (string)(secondspassed - (minutespassed * 60));
59 if(llStringLength(llGetSubString(timeleft,llSubStringIndex(timeleft,":") + 1,llStringLength(timeleft))) == 1)
60 {
61 timeleft = llGetSubString(timeleft,0,llStringLength(timeleft) - 2) + "0" +
62 llGetSubString(timeleft,llStringLength(timeleft) - 1, llStringLength(timeleft));
63 }
64 if(llStringLength(llGetSubString(timepassed,llSubStringIndex(timepassed,":") + 1,llStringLength(timepassed))) == 1)
65 {
66 timepassed = llGetSubString(timepassed,0,llStringLength(timepassed) - 2) + "0" +
67 llGetSubString(timepassed,llStringLength(timepassed) - 1, llStringLength(timepassed));
68 }
69 llSetText(llKey2Name(sitter) + " Is Sitting On Me!" + "\n " + timepassed + " Has Passed!" + "\n " + timeleft +
70 " Left untill next payment!",<0,1,0>,1.0);
71 if(secondspassed >= totaltime)
72 {
73 llSay(0,llKey2Name(sitter) + ", You sat on me for " + timepassed + " and earned L$" +
74 (string)moneyamount + "!");
75 llGiveMoney(sitter,moneyamount);
76 llUnSit(sitter);
77 }
78 }
79 }
80 }

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