Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Tip Jar Script

Keiki Lemieux
I make HUDDLES
Join date: 8 Jul 2005
Posts: 1,490
08-26-2005 16:56
Anyone know where I can find a simple tip jar script which I can set for multiple hosts with commands to change the host? Basically I'm looking for something like what they have at most Tringo spots that give somewhere for the patrons to tip the host.

ty
Lucas Sion
Registered User
Join date: 25 Aug 2005
Posts: 16
tip jar got it
08-26-2005 17:39
TIP JAR SCRIPT TO FOLLOW hope it helps

default
{
state_entry()
{
llSetText(llKey2Name(llGetOwner())+"'s tip jar.\nTip if you are so inclined!",<1,1,1>,1); //text above jar with owners name
}

money(key id, integer amount)
{
llInstantMessage(id,"Thanks for the tip!";); //IM for the tipper
llInstantMessage(llGetOwner(),llKey2Name(id)+" tipped $" + (string)amount);//Im to the owner with tippers name and amount
}
}
Lucas Sion
Registered User
Join date: 25 Aug 2005
Posts: 16
Tip Jar
08-26-2005 17:44
//A Lucas Sion Production
//TIP JAR SCRIPT TO FOLLOW
//I hope it helps you out
default
{
state_entry()
{
llSetText(llKey2Name(llGetOwner())+"'s tip jar.\nTip if you are so inclined!",<1,1,1>,1); //owners name and tip message
}

money(key id, integer amount)
{
llInstantMessage(id,"Thanks for the tip!";); //IM to tipper
llInstantMessage(llGetOwner(),llKey2Name(id)+" tipped $" + (string)amount); //IM to owner with tippers name and amount tipped
}
}
a lost user
Join date: ?
Posts: ?
08-26-2005 19:03
CODE

key host_key; // Used to pay the host.
string host_name; // Keep host's name, even if they are out of the sim
integer channel = 9999; // Change this number for a secure channel number
integer listening;

Init()
{
llSay(0, "Setting up Tip Jar...");
host_key = NULL_KEY;
host_name = "";
llSetText("Touch Here to Set Host",<1,1,1>,1);
}

start_listen()
{
if(listening) llListenRemove(listening);
listening = llListen(channel,"","","");
}

default
{
on_rez(integer param)
{
// Reset the script when a new tip jar is placed on the ground.
llResetScript();
}

state_entry()
{
// So the jar can give refunds and pay the hosts, the owner must give it
// permission to take money from them.
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
Init();
}

touch_start(integer num_detected)
{
// Only allow people in the same group to set themselves as host.
if(llSameGroup(llDetectedKey(0)) == FALSE)
return;

llDialog(llDetectedKey(0),"Tip Jar Options",["Reset","Set Host"],channel);
start_listen();
}

listen(integer channel, string name, key id, string message)
{
llListenRemove(listening);
if(message == "Reset")
{
Init();
return;
}

if(message == "Set Host")
{
host_key = id;
host_name = name;
llSetText("Pay here to tip the host:\n" + host_name,<1,1,0>,1);
}
}

money(key id, integer amount)
{
if(host_key == NULL_KEY)
{
llSay(0, "No host has been set, refunding your money.");
llGiveMoney(id,amount);
return;
}

llSay(0, "Thankyou for your generosity " + llKey2Name(id));
llInstantMessage(host_key,llKey2Name(id) + " has tipped you " +
(string)amount + " Lindens.");

// Transfer money to the host.
llGiveMoney(host_key,amount);
}

run_time_permissions(integer perms)
{
if(perms & PERMISSION_DEBIT)
{
llOwnerSay("/me will now be able to function correctly.");
return;
}
else
{
llOwnerSay("You must give permission for the tip jar to take money from you.");
llSleep(5.0);
llResetScript();
}
}
}
a lost user
Join date: ?
Posts: ?
08-26-2005 19:11
If you want something to split the money.. well.. contact me in the game. There's quite a variety of options, including an access list from a notecard (if the people are not in the same group for example), percentage splitting, giving a cut to the owner and all that kind of stuff.

This example I gave above, I just wrote in a few minutes so I am happy to share my knowledge freely.. but for more custom work I will have to charge a small fee.