LSL Scripts: Face Number Indicator

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

touch_start(integer num_detected)
integer numOfSides = llGetNumberOfSides();
llOwnerSay(”I have ” + (string)numOfSides + ” sides.”);
llSetTexture(”70343f85-e3fe-4a42-aeac-528c5a847779″, 0);
llSetTexture(”f3ab6a27-7045-4e79-afd2-c4e206c8bdac”, 1);
llSetTexture(”ef765939-08c8-4fbe-988c-cce36609e1ac”, 2);
llSetTexture(”ab48b391-bafe-41af-8466-c8fae88fd1d8″, 3);
llSetTexture(”5cba8dd6-b26f-49e6-89f4-3515c7a6e2fc”, 4);
llSetTexture(”144c14dd-e2f6-4907-81b7-66f90dcde3b6″, 5);
llSetTexture(”b6e0602e-9805-4348-a649-f1530e0d7c19″, 6);
llSetTexture(”db9bbf0f-f42d-4c45-92c1-4543a60e04e4″, 7);
llSetTexture(”17ec5ad8-bcb4-468d-931a-d5c57fb6147a”, 8);

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.

Remona Stormborn

Co-Owner of Gaia Foundation in the Great Canadian Grid. Owner of the Builders Resource Center, Rose City Design, & IDEA! in the Great Canadian Grid & InWorldz.

Latest posts by Remona Stormborn (see all)

Scroll Up