OsGetLinkInventoryKey
From OpenSimulator
(Difference between revisions)
JeffKelley (Talk | contribs) m (Example added) |
JeffKelley (Talk | contribs) m (Edited example comment) |
||
(One intermediate revision by one user not shown) | |||
Line 9: | Line 9: | ||
// osGetLinkInventoryKey Script Example | // osGetLinkInventoryKey Script Example | ||
// | // | ||
− | // This script runs in | + | // This script runs in a child prim |
// It will paint the prim with | // It will paint the prim with | ||
// a texture in root inventory | // a texture in root inventory | ||
Line 20: | Line 20: | ||
key textureUuid = osGetLinkInventoryKey (LINK_ROOT, textureName, INVENTORY_TEXTURE); | key textureUuid = osGetLinkInventoryKey (LINK_ROOT, textureName, INVENTORY_TEXTURE); | ||
llOwnerSay ("Painting prim with texture "+textureUuid); | llOwnerSay ("Painting prim with texture "+textureUuid); | ||
− | if ( | + | if (textureUuid != NULL_KEY) |
llSetTexture (textureUuid, ALL_SIDES); | llSetTexture (textureUuid, ALL_SIDES); | ||
} | } |
Latest revision as of 02:01, 22 June 2024
key osGetLinkInventoryKey(integer linkNumber, string name)
| |
Returns id(key) of a inventory item asset within a prim inventory. If name is not unique result maybe unpredictable. This function extends llGetInventoryKey( string name ) to links. Returns NULL_KEY if the item is not found or Owner has no rights | |
Threat Level | This function does not do a threat level check |
Permissions | Script owner needs modify, copy and transfer rights |
Extra Delay | 0 seconds |
Example(s) | |
// // osGetLinkInventoryKey Script Example // // This script runs in a child prim // It will paint the prim with // a texture in root inventory default { state_entry() { string textureName = "K1100RS"; key textureUuid = osGetLinkInventoryKey (LINK_ROOT, textureName, INVENTORY_TEXTURE); llOwnerSay ("Painting prim with texture "+textureUuid); if (textureUuid != NULL_KEY) llSetTexture (textureUuid, ALL_SIDES); } } | |
Notes | |
osGetInventoryItemKey added in 0.9.1.0 Dev, Implemented August, 16 2019 osGetLinkInventoryKey added in 0.9.3.0 Dev, March 2024 |
See Also: