Group Discount sale script

Thread Started By Bonfire

3840
1
  • 52 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rate Thread
#1
Fill in the price and discount percentage and put the script in the box with the product you intend to sell.
The product will sell at normal price but refund the percentage to members of the group.
Make sure the product box is set to the group you want to get discount.

[Image: Group%20discount%20sales%20script.jpg?1288341165]

Group Discount sale script:
PHP Code:
///Amon Dragonash - april 2010
///A simple as possible script to use, making your boxes give discount on the product to group members.

///Before we start, please don't put this in an otherwise empty box.
///The script doesnt check to see if there actually is something before it starts the sale!

///After editting the script, changing the price and discount percentage to whatever you want it to be..
///..drop the script in the product box of your choice.
///Then make sure the product box is set to the group you want to get discount and you are done.

///The script will present the customer with a pay menu with the normal price and check the group tag they wear to be the same as the one the product is set to before delivering. On delivery it refunds the correct amount as discount to group members. If anything doesnt add up it won't deliver and will refund the money. (It won't refund though if there was no product to deliver.)

///Now let's get started and change the price in the next line to the amount of lindens you want it to be.
integer price 60;
///Now set the number in percentage you want to give as discount.. for example 20 means they get 20% discount.
integer discount 10;

///Leave the rest of the script alone and save it, then drop it into the product box and set that to group and that's it.
 
default
{
    
state_entry()
    {
        
llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDEPAY_HIDEPAY_HIDE]);
        
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
    }
    
run_time_permissions(integer perm)
    {
        if(
perm PERMISSION_DEBIT)
            
state cash;
    }
}
 
 
state cash
{
    
state_entry()
    {
        
llSetPayPrice(PAY_HIDE, [price ,PAY_HIDEPAY_HIDEPAY_HIDE]);
    }
    
money(key idinteger amount)
    {
        if(
amount != price)
        {
            
///Wrong amount paid. Refund and tell the person in chat.
            
llGiveMoney(idamount);
            
llSay(0"You paid "+(string)amount+", which is the wrong price. Your money has been refunded. The correct price for this item is: "+(string)price);
        }
        
        else if (
llSameGroup(id) == TRUE)
        {
            
///Everything is okay, continue delivering product(s) and calculate the group discount.
            
list lGive = [];
        
string sName llGetScriptName();
        
integer iInventory llGetInventoryNumber(INVENTORY_ALL);
        while(--
iInventory>=0)
        {
            
string sItem llGetInventoryName(INVENTORY_ALL,iInventory);
            if( 
sItem != sName)
                
lGive += sItem;
        }
        
llGiveInventoryListidllGetObjectName(), lGive);
        
integer returnmoney llRound(amount discount 100);
        
llGiveMoney(idreturnmoney);
        }
        
        else
        {
            
///Right price wrong group.. deliver product(s) but no discount.
            
list lGive = [];
        
string sName llGetScriptName();
        
integer iInventory llGetInventoryNumber(INVENTORY_ALL);
        while(--
iInventory>=0)
        {
            
string sItem llGetInventoryName(INVENTORY_ALL,iInventory);
            if( 
sItem != sName)
                
lGive += sItem;
        }
        
llGiveInventoryListidllGetObjectName(), lGive);
        }
    }


hope you like and Enjoy :)

hit the thank you and the rep button if you Copy or download
Reply


#2
nice nice thanks i can use this.
Reply




Possibly Related Threads…
Thread Author Replies Views Last Post
  Give to Group Only script IAmFireProof 0 2,409 03-20-2016, 07:25 PM
Last Post: IAmFireProof
  Unpacker+ Delivery Confirmation+join Group Script Bonfire 0 2,795 11-28-2014, 07:53 AM
Last Post: Bonfire
  Group Discount sale script steadymobbin 0 1,817 02-18-2013, 02:06 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...