Don't click here unless you want to be banned.

LSL Wiki : llGetScriptName

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
string llGetScriptName()

Returns the name of this script (in the object inventory), and not the name of the object in which this script resides.

To get the name of the object, use llGetObjectName.

Q: I'm trying to use this to differentiate between several otherwise identical scripts, but something's going horribly wrong! Why is this happening and what do I do to fix it?
A: If you do just a copy & paste, I believe that you get always the name of the "first" script, because the UUID of the script is always the same. Each time you save a script it gets a new asset key. The quickest way to get a new key is to simply edit each script and save it, generating a new key. One way to ensure they all have unique keys is to add a unique comment to the top of each script.

Q: Is there a way to determine the number of the script? If I do a for loop and run through all scripts by name, the scripts are in order. How do I find out where a given script is in the list?
A: You can't directly. Scripts will always have a unique name in an object, so you can check using llGetInventoryNumber and a for loop containing llGetInventoryName, then comparing to the results of llGetScriptName.

Note: In SL 1.9.0, llGetScriptName correctly returns numbered names (e.g. "New Script", "New Script 1", etc).

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Inventory | Script | Name
There is one comment on this page. [Display comments/form]