Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripting help/question

kizmit Kamachi
Registered User
Join date: 30 Apr 2007
Posts: 3
03-24-2008 06:32
I am looking for a couple of scripts for my current project.
I am making a bed with a curtain.

the first script i am looking for will allow the curtain to cycle through textures on the first click, so that it looks as if the curtain is rising. then stop when it reaches the top. Then on next click, cycle back down.

the second i am looking for is for the "frame" of the bed. to be able to click touch the frame to choose different textures on just the frame itself. I have found a couple scripts that are supposed to do this, but so far have not been able to get them to work.

I am so incredibly new to scripting, it is possible i am just doing something wrong. any help, suggestions, tips or just a point in the right direction would be greatly appreciated.
Blu Laszlo
Registered User
Join date: 3 Feb 2007
Posts: 8
03-24-2008 14:28
Here is something o get you started:

list textures = ["UUID1", \
"UUID2",
"UUID3"
];
integer face = 0;
integer count = 0;
integer num = 0;

default
{
state_entry()
{
num = llGetListLength(textures);
}

touch_start(integer total_number)
{
if ( llDetectedKey(0) != llGetOwner() ) // only listens to the owner
return;

if (count < num-1)
count ++;
else
count = 0;
string texture = llList2String(textures,count);
llSetPrimitiveParams([PRIM_TEXTURE, face, texture, <0.9,0.85,0.0>, <0.0,0.0,0.0>, 0.0]);
}
}