Created
September 26, 2013 22:49
-
-
Save jonasbits/6721700 to your computer and use it in GitHub Desktop.
MetaverseArchive Offer Inventory script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default { | |
state_entry() | |
{ | |
llAllowInventoryDrop(TRUE); | |
llSetText("", <1,1,1>, 1.5); | |
llSetPayPrice(1, [PAY_HIDE,PAY_HIDE,PAY_HIDE,PAY_HIDE]); | |
} | |
money(key id, integer amount) | |
{ | |
llOwnerSay("test" + (string)amount); | |
//it does not work to pay "0" lindens, this event wont trigger | |
//in a non scripting sandbox, this script will not run | |
} | |
touch_start(integer total_number) { | |
list inventory; | |
string name; | |
integer num = llGetInventoryNumber(INVENTORY_ALL); | |
integer i; | |
for (i = 0; i < num; ++i) { | |
name = llGetInventoryName(INVENTORY_ALL, i); | |
if(llGetInventoryPermMask(name, MASK_NEXT) & PERM_COPY) | |
inventory += name; | |
else | |
llSay(0, "Don't have permissions to give you \""+name+"\"."); | |
} | |
//we don't want to give them this script | |
i = llListFindList(inventory, [llGetScriptName()]); | |
inventory = llDeleteSubList(inventory, i, i); | |
if (llGetListLength(inventory) < 1) { | |
llSay(0, "No items to offer."); | |
} else { | |
// give folder to agent, use name of object as name of folder we are giving | |
llGiveInventoryList(llDetectedKey(0), llGetObjectName(), inventory); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment