302
TRANSACTION
BASICS
REDISTRIBUTING
WEALTH
SELLING IT!
RENTALS AND
SERVICES
GAMBL...
UH... GAMES
OF SKILL
SUMMARY
default
{
state_entry() {
displayLabel();
llSetPayPrice(10, [PAY_HIDE, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
llSitTarget(<0,0,0.1>, ZERO_ROTATION);
}
money(key who, integer lindens) {
gName = llKey2Name(who);
gKey = who;
gAltitude += lindens;
llSay(0, "OK, "+gName+"! now sit and get a ride to "+
(string)(gAltitude*100) + " meters!");
llSetTimerEvent(30.0);
displayLabel();
}
changed(integer bits) {
if (bits & CHANGED_LINK) {
key av = llAvatarOnSitTarget();
if (av == gKey && av != NULL_KEY) {
llSay(0, "Hold on!!!");
integer i;
for (i=10; i>0; i--) {
llSay(0, (string)i+"...");
llSleep(1.0);
}
llShout(0, "Blast off!");
vector home = llGetPos();
vector dest = home+<0,0,gAltitude*100.0>;
moveTo(home, dest);
llUnSit(av);
moveTo(dest, home);
gKey = NULL_KEY;
gName = "";
gAltitude=0;
} else {
llSay(0, "Please pay me first");
llUnSit(av);
}
displayLabel();
}
}
timer() {
if (gKey != NULL_KEY) {
llSay(0, "Timing out: "+gName+" seems to have lost interest");
gKey = NULL_KEY;
gName = "";
gAltitude = 0;
displayLabel();
}
llSetTimerEvent(0.0);
}
}
This is really just a high-altitude intrasim teleporter, using the moveTo() function from Chapter 2.
The difference is that it won't operate until you've paid it. It sets up a payment box in state_entry()
to reserve the device. Once an avatar has paid it, he can sit and be transported straight up 100 meters
for every Linden dollar paid (to a maximum of 4,096m). When the avatar reaches the paid-for height, the
script unsits the passenger and returns home to reset. You could slow it down and offer the passenger a
parachute on the way up, or follow a path through a psychedelic panorama.