Script is below, but not complete in some formats due to it is not a free script.
Please forgive not posting the entire script it is a collaboration script and the other person does not want the sript public for some of the things it does. If you have an ide of how I can do this please post for me and I will try it and if it works you will be put in the split on the sale of it. Thanks Sal.
CODE
----
Removed for sale reasons
----
integer pointer=0;
key dancer;
integer take;
string dancerName;
float toDancer;
float toManager;
integer len;
default
{
state_entry()
run_time_permissions(integer perm)
{
if(perm & PERMISSION_DEBIT)
{
llGetNotecardLine("managers", pointer);
} else
{
llSay(0, "The owner MUST allow debit permissions for this to work.");
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
}
dataserver(key id, string data)
{
if(data!=EOF)
{
managers+=(key)data;
pointer++;
llGetNotecardLine("managers", pointer);
} else
{
toDancer=(float)cutToDancer/100.0;
toManager=1.0-toDancer;
len=llGetListLength(managers);
toManager/=(float)len;
state ready;
}
}
}
state ready
{
state_entry()
{
llSetText("Tip jar - not currently in use", colour, 1.0);
}
changed(integer change)
{
if((change & CHANGED_OWNER) || (change & CHANGED_INVENTORY))
{
-------------
{
llInstantMessage(llDetectedKey(0), "This only works for dance group members with their group active!");
}
}
}
state working
{
state_entry()
{
take=0;
llSensorRepeat("", dancer, AGENT, 96, PI, 60.0);
}
touch_start(integer num)
{
if(llDetectedKey(0)==dancer ||llDetectedKey(0)==llGetOwner())
{
state ready;
}
}
state_exit()
{
integer i;
for(i=0; i<len; ++i)
{
llInstantMessage(llList2Key(managers, i), dancerName+" has just finished. She took a total of "+(string)take+" in tips.");
}
take=0;
dancer=NULL_KEY;
dancerName="";
}
money(key id, integer cash)
{
take+=cash;
integer temp=cash;
integer payManagers=llRound(temp * toManager);
integer i;
for(i=0; i<len; ++i)
{
llGiveMoney(llList2Key(managers, i), payManagers);
temp-=payManagers;
}
llGiveMoney(dancer, temp);
llSetText("Tip Jar\nTips go to "+dancerName+"\nTips so far: "+(string)take, colour, 1.0);
}
no_sensor()
integer cutToDancer=80; //Put in the percentage you are going to give to the dancers here. The remainder will be automatically split evenly between the people whose keys are in the managers notecard 60 is 60% to the dancers - 2 managers would get 20% each, 3 would get 6.66% each etc...
vector colour=<1.0, 1.0, 1.0>; //Set this to change the hover text colour.
list managers;
integer pointer=0;
key dancer;
integer take;
string dancerName;
float toDancer;
float toManager;
integer len;
default
{
state_entry()
{
llSetText("Tip jar - setting up", colour, 1.0);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
run_time_permissions(integer perm)
{
if(perm & PERMISSION_DEBIT)
{
llGetNotecardLine("managers", pointer);
} else
{
llSay(0, "The owner MUST allow debit permissions for this to work.");
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
}
}
dataserver(key id, string data)
{
if(data!=EOF)
{
managers+=(key)data;
pointer++;
llGetNotecardLine("managers", pointer);
} else
{
toDancer=(float)cutToDancer/100.0;
toManager=1.0-toDancer;
len=llGetListLength(managers);
toManager/=(float)len;
state ready;
}
}
}
state ready
{
state_entry()
{
llSetText("Tip jar - not currently in use", colour, 1.0);
}
changed(integer change)
{
if((change & CHANGED_OWNER) || (change & CHANGED_INVENTORY))
{
llResetScript();
}
}
touch_start(integer num)
{
if(llSameGroup(llDetectedKey(0)))
{
dancer=llDetectedKey(0);
dancerName=llDetectedName(0);
state working;
} else
{
--------------
}
}
}
state working
{
state_entry()
{
take=0;
llSetText("Tip Jar\nTips go to "+dancerName+"\nTips so far: "+(string)take, colour, 1.0);
llSensorRepeat("", dancer, AGENT, 96, PI, 60.0);
}
touch_start(integer num)
{
if(llDetectedKey(0)==dancer ||llDetectedKey(0)==llGetOwner())
{
state ready;
}
}
state_exit()
{
integer i;
for(i=0; i<len; ++i)
{
llInstantMessage(llList2Key(managers, i), dancerName+" has just finished. She took a total of "+(string)take+" in tips.");
}
take=0;
dancer=NULL_KEY;
dancerName="";
}
money(key id, integer cash)
{
take+=cash;
integer temp=cash;
integer payManagers=llRound(temp * toManager);
integer i;
for(i=0; i<len; ++i)
{
llGiveMoney(llList2Key(managers, i), payManagers);
temp-=payManagers;
}
llGiveMoney(dancer, temp);
llSetText("Tip Jar\nTips go to "+dancerName+"\nTips so far: "+(string)take, colour, 1.0);
}
no_sensor()
{
state ready;
}
}
}