Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

SetTexture in linked prims. How I do that?

Steve Memotech
Registered User
Join date: 27 Mar 2007
Posts: 20
06-27-2007 21:27
Hi.. I have here a code that will change the texture once I touch the prim. But I have a problem when I copied it and link it, the SetTexture function will not work as a whole object.

CODE

default
{
state_entry()
{
}
touch_start(integer total_number)
{
integer number = llGetInventoryNumber(INVENTORY_TEXTURE);
float rand = llFrand(number);
integer choice = (integer)rand;
string name = llGetInventoryName(INVENTORY_TEXTURE, choice);
if (name != "")
{
llSetTexture(name, ALL_SIDES);
}
}
}


How will I script of a linked prims using llSetTexture function? Thanks in advance.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
06-27-2007 23:04
llSetLinkTexture
Steve Memotech
Registered User
Join date: 27 Mar 2007
Posts: 20
07-01-2007 22:24
Thanks, it solved my problem.
Ludvaig Lindman
Registered User
Join date: 2 Feb 2007
Posts: 78
07-21-2007 14:08
Trying to use that script. Why doesnt it work? I changed llSetTexture to llSetLinkTexture, but i get an error when compiling. - ERROR: Function call mismatches type or number of arguments.

thanks for helping...
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
07-21-2007 14:41
You need to add a prim number:

llSetLinkTexture( link_number, name, ALL_SIDES );