Profit Splitter

Thread Started By TrueFreak

2343
0
  • 36 Vote(s) - 3.61 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rate Thread
#1
Self explaining i guess


Quote:/*

Rekson Profit Spliter

If you need any help with this script or are unsure about anything send me a message on Scaler Rexen and I will gladly assist you.

*/

key owner;
integer pay;

// Change only these items below

key partner="5ffbf977-2cf1-4fd1-b531-102e19147d1b"; // Put the persons key you will want to split the money with.
float split=.5; // .10 is 10% | .20 is 20% | .30 is 30% etc
integer cost=250; // How much does your item cost.

// Do not change anything else unless you know what you're doing.

default
{
on_rez(integer p)
{
if(llDetectedKey(0)!=owner)
{
llResetScript();
}
}
state_entry()
{
owner=llGetOwner();
if(partner!="")
{
float splitAmount=split*100;
if(splitAmount<=100.0)
{
pay=llRound(cost*split);
llSetPayPrice(PAY_HIDE,[cost,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
llRequestPermissions(owner,PERMISSION_DEBIT);
llOwnerSay("Your vendor is all set the split amount is %"+(string)splitAmount);
}
else
{
llOwnerSay("WARNING:: Your split amount is over 100% it's currently at %"+(string)splitAmount);
}
}
else
{
llOwnerSay("You need to set your partners key in the script, once you add the key at the top of the script reset the script.");
llSetPayPrice(PAY_HIDE,[PAY_HIDE,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
}
}
money(key id, integer amount)
{
if(amount < cost)
{
llRegionSayTo(id,0,"You did not pay the full amount to purchase this item it cost L$"+(string)cost);
llGiveMoney(id,amount);
}
else
{
llGiveMoney(partner,pay);
string object=llGetInventoryName(INVENTORY_OBJECT,0);
llGiveInventory(id,object);
}
}
}
Reply




Possibly Related Threads…
Thread Author Replies Views Last Post
  CDru Split Profit Script steadymobbin 0 3,081 02-18-2013, 02:34 AM
Last Post: steadymobbin

Forum Jump:

1 Guest(s)
Share this:

About Second Life Copybot

Second Life CopyBot Forum is a place where you can get items for Second Life and other vitual worlds for free. With our CopyBot viewers you can export and import any content from these virtual worlds and modify them in 3D software such as Blender, 3D studio Macx etc...