“LlGiveInventoryList”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: llGiveInventoryList( key target, string folder, list inven…”) |
|||
| 第62行: | 第62行: | ||
} | } | ||
<pre> | <pre> | ||
| + | |||
| + | |||
示例二 | 示例二 | ||
<pre> | <pre> | ||
| 第101行: | 第103行: | ||
} | } | ||
<pre> | <pre> | ||
| + | |||
|相关函数= | |相关函数= | ||
2020年8月20日 (四) 09:25的版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: llGiveInventoryList( key target, string folder, list inventory ); |
参数:
|
| 返回值:
将库存项目提供给目标,创建一个新的文件夹来放置它们。 |
| 注意事项 |
|---|
*这个函数会让脚本休眠3.0秒。
|
| 示例 |
|---|
示例一
// when the prim is touched, the script checks all other inventory items whether or not they're copiable
// copiable items are added to a list, if the list is not empty when all items have been checked
// the prim gives them to the touching avatar within a single folder
default
{
touch_start(integer num_detected)
{
string thisScript = llGetScriptName();
list inventoryItems;
integer inventoryNumber = llGetInventoryNumber(INVENTORY_ALL);
integer index;
for ( ; index < inventoryNumber; ++index )
{
string itemName = llGetInventoryName(INVENTORY_ALL, index);
if (itemName != thisScript)
{
if (llGetInventoryPermMask(itemName, MASK_OWNER) & PERM_COPY)
{
inventoryItems += itemName;
}
else
{
llSay(0, "Unable to copy the item named '" + itemName + "'.");
}
}
}
if (inventoryItems == [] )
{
llSay(0, "No copiable items found, sorry.");
}
else
{
llGiveInventoryList(llDetectedKey(0), llGetObjectName(), inventoryItems); // 3.0 seconds delay
}
}
}
|
| 相关函数 |
|---|
| llGiveInventory |
| 相关事件 |
|---|
| changed |