Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Linked Texture Changer
- Created 2020-07-01 by Bugs Larnia
- Please keep anotations
- */
- //USER SETTINGS
- integer giTexturePrimNo = LINK_ALL_OTHERS;
- integer giTextureFaceNo = ALL_SIDES;
- //Enter your texture keys in this list, separated by commas
- list glTextures =
- [
- "a11c5aeb-5ec9-7178-2fb3-efc7347c18c5",
- "7f4fd01d-08b6-ff8b-b0dc-2d785d3c9cb4",
- "4045f426-4893-59be-c496-ffd471e1267e"
- ];
- //END USER SETTINGS
- integer giIndex;
- Init()
- {
- if (GetImageCount() == 0)
- {
- return;
- }
- ResetIndex();
- ShowImage();
- }
- ShowNextImage()
- {
- integer iCount = GetImageCount();
- if (iCount == 0)
- {
- return;
- }
- if (++giIndex >= iCount)
- {
- ResetIndex();
- }
- ShowImage();
- }
- ShowImage()
- {
- llSetLinkTexture(giTexturePrimNo, llList2Key(glTextures, giIndex), giTextureFaceNo);
- }
- integer GetImageCount()
- {
- return llGetListLength(glTextures);
- }
- ResetIndex()
- {
- giIndex = 0;
- }
- default
- {
- state_entry()
- {
- Init();
- }
- touch_start(integer piNum)
- {
- ShowNextImage();
- }
- on_rez(integer piParam)
- {
- llResetScript();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement