02-18-2013, 01:45 AM
PHP Code:
integer price = 10; //enter your price here
string text = ""; //write a text between the quote marks that will be displayed as float text (optional). If you want multiple lines, write \n like this: "Object for sale\n10L$", this will display "Object for sale" in one line, "10L$" in the other.
default
{
state_entry()
{
llSetPayPrice(PAY_HIDE, [price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
llSetText(text, <1, 1, 1>, 1);
}
touch_start(integer total_number)
{
if (llGetInventoryNumber(INVENTORY_NOTECARD) > 0)
llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_NOTECARD, 0));
}
money(key id, integer amount)
{
if (amount == price)
{
integer i;
integer len = llGetInventoryNumber(INVENTORY_OBJECT);
for(i=0; i<len; i++)
llGiveInventory(id, llGetInventoryName(INVENTORY_OBJECT, i));
}
else
llInstantMessage(id, "Sorry, that is not the right amount");
}
}