Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetTexture Question

Mazack Frua
Registered User
Join date: 9 Dec 2005
Posts: 5
01-22-2006 20:52
Can anyone tell me why this isn't working?



key owner;

default
{
state_entry()
{
llWhisper(0, "Activated";);
owner = llGetOwner();
llListen(0,"",owner,"on";);
llListen(0,"",owner,"off";);
}

listen(integer channel, string name, key id, string m)
{
if (m == "on";)
{
llSetTexture(32293f56-5f06-f937-365c-4f7ad8dd0743, ALL_SIDES);
}
if (m == "off";)
{
llSetTexture(59facb66-4a72-40a2-815c-7d9b42c56f60, ALL_SIDES);
}
}
}
Mazack Frua
Registered User
Join date: 9 Dec 2005
Posts: 5
01-22-2006 21:09
bump
_____________________
Beatfox Xevious
is THOUSANDS OF PEOPLE
Join date: 1 Jun 2004
Posts: 879
01-22-2006 21:46
Key constants are represented as strings, and as such should always be put in quotes.

Also, you should only create 1 listen when using a single channel. The listener will always process everything that's said on a channel, regardless of who said it or what was said; any filters specified in the llListen command will then be applied just like an "if" statement. Therefore, the server actually ends up doing more work unnecessarily if you make a separate listen for each command. You might also consider using a channel other than 0 for the same reason (no point in processing everyone's chat).

CODE
key owner;

default
{
state_entry()
{
llOwnerSay("Activated");
owner = llGetOwner();
llListen(0,"",owner,"");
}

listen(integer channel, string name, key id, string m)
{
if (m == "on")
{
llSetTexture("32293f56-5f06-f937-365c-4f7ad8dd0743", ALL_SIDES);
}
else if (m == "off")
{
llSetTexture("59facb66-4a72-40a2-815c-7d9b42c56f60", ALL_SIDES);
}
}
}
_____________________
My Beatworks: Zephyr Chimes wind chimes, the KanaMaster Japanese kana tutor, and the FREE Invisibility Prim Public. Look for them at the Luskwood General Store in Lusk (144, 165).

"You have been frozen. You cannot move or chat. A pony will contact you via instant message (IM)."
- mysterious system message I received after making off with Pony Linden
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
01-22-2006 21:51
need " " around UUID
CODE
key owner;

default
{
state_entry()
{
llWhisper(0, "Activated");
owner = llGetOwner();
llListen(0,"",owner,"on");
llListen(0,"",owner,"off");
}

listen(integer channel, string name, key id, string m)
{
if (m == "on")
{
llSetTexture("32293f56-5f06-f937-365c-4f7ad8dd0743", ALL_SIDES);
}
if (m == "off")
{
llSetTexture("59facb66-4a72-40a2-815c-7d9b42c56f60", ALL_SIDES);
}
}
}PHP]