CODE
//Script by Ryen Jade, with help from david linden
//You may not resell this scipt
//Change amount here to change the price
//Copyright 2004-2005
integer Qeamount = 550;
integer balance = 0;
string object;
check()
{
string object = llGetInventoryName(INVENTORY_OBJECT,0);
integer count = llGetInventoryNumber(INVENTORY_OBJECT);
if(count > 0)
{
llWhisper(0, "I will sell " + (string)object + " for " + (string)Qeamount + "L$");
llSetObjectName(object);
}
else
{
llSetObjectName("No object for sale");
llWhisper(0,"No object currently for sale");
}
}
default
{
on_rez(integer null)
{
string object = llGetInventoryName(INVENTORY_OBJECT,0);
check();
}
state_entry()
{
string object = llGetInventoryName(INVENTORY_OBJECT,0);
llWhisper(0, "I will sell " + (string)object + " for " + (string)Qeamount + "L$");
llSetText("Pay me for "+object+",im selling it for "+(string)Qeamount+"L$!",<1,1,0>,TRUE);
}
touch_start(integer null)
{
string object = llGetInventoryName(INVENTORY_OBJECT,0);
llWhisper(0, "I will sell " + (string)object + " for " + (string)Qeamount + "L$");
llSleep(3);
}
changed(integer null)
{
check();
}
money(key id, integer amount)
{
string object = llGetInventoryName(INVENTORY_OBJECT,0);
balance+=amount;
if(balance >= Qeamount)
{
llGiveInventory(id,llGetInventoryName( INVENTORY_OBJECT,0));
llWhisper(0,"Thanks for your purchase of the " + object);
}
else
{
llWhisper(0,"You need to enter more money for this object!");
}
}
}
edit-fixed a small presentation error, so that it can be copied and pasted into a script. (it was the forum rendering engine, not your script
