Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Show Picture of who touch the prim

Sin Poitier
RL is calling
Join date: 5 Mar 2007
Posts: 52
06-05-2007 17:06
Hi....managing to create this script i mixed from others, but i can't get it to show the picture (couple of textures inside the prim) of who touch it.
Being working like 4 or 5 days, but nothing. This is what i got:
CODE

default
{
on_rez(integer start_param)
{
llResetScript();
}

state_entry()
{
llSetColor(<0,0,1>, -1);
llSetText("No Busy", <1,1,1>, 1);

}

touch_start(integer num)
{
state on;
llInstantMessage(llDetectedKey(0),"Hi");
}
}

state on
{
state_entry()
{
llSetColor(<1,0,0>, -1);
llSetText("Busy", <1,0,0>, 1);
llDetectedName(name)
llSetTexture(llGetInventoryName(name, 0),1)
}
}

touch_start(integer num)
{
state default;
}
}




I tried to set one variable for the name of the avatar, but it always gave me a syntax error, so i deleted that part.
Can anyone help me with this? Where is the problem here?

Thx.
Sin
_____________________
Me? No, i'm just part of your imagination.

C.I.G. CEO
Jefe de "Chilenos en SL"
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
06-05-2007 17:10
When you say state default from within state default, it doesn't run state entry.

Try moving your texture stuff out of state entry and put it in the touch event.
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
06-05-2007 17:40
This statement:

llDetectedName(name)

besides missing a semicolon, probably would fail. The detected functions only work inside certain events. So back in your default touch entry, you should set a global to that:

name = llDetectedName(0);

Then name should be available to your texture commands.

(name will, of course, have to be declated a global at the beginning of your script.)