When scripting with LSL you sometimes need to know the face numbers of your object(s). Here’s a script for finding the face number of the faces on an object by applying, on touch, a texture to each face of the object, that indicates it’s face number. The total number of faces on the object will be given to the owner in nearby chat.
To try it out, just copy the script below and paste it into a New Script. Save the script & put it in your object. Make sure the script is set to running, close the Build Window and touch the object. Be sure to check Nearby chat for the total number of faces on your object.
The script can be put in any object in a linked set but will only return the numbers for the object(S) that the script is in when that specific object is touched.
//Copyright Remona Stormborn 2015
//Share Willy-Nilly, Credit need not be given
integer numOfSides = llGetNumberOfSides();
llOwnerSay(”I have ” + (string)numOfSides + ” sides.”);
NOTE: This only works in InWorldz. To adapt to other worlds you will need to create and upload textures for each number 0-8 and upload the textures. Right click each texture in your inventory to get it’s UUID number and replace the UUID numbers in this script on the appropriate line. Remember that face numbering starts at 0.