Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Script to IM on touch?

Neehai Zapata
Unofficial Parent
Join date: 8 Apr 2004
Posts: 1,970
07-28-2004 08:20
Is there a way to make a script that will IM a single message (2 or 3 words) to the person who touches it?

If so, is it also possible to set specific parameters for it not to give the message to certain people?

In other words, there is a box, if I click it, it sends me an IM of "52". If you click it, it says nothing.
_____________________
Unofficial moderator and proud dysfunctional parent to over 1000 bastard children.
Ezhar Fairlight
professional slacker
Join date: 30 Jun 2003
Posts: 310
07-28-2004 08:35
Something like that:

CODE
list	gUsers = ["Ezhar Fairlight", "Neehai Zapata", "Someone else"];

default {
touch_start(integer num_detected) {
if (llListFindList(gUsers, [llDetectedName(0)]) >= 0) {
llInstantMessage(llDetectedKey(0), "bananaphone");
}
}
}
_____________________
Neehai Zapata
Unofficial Parent
Join date: 8 Apr 2004
Posts: 1,970
07-28-2004 08:58
Thank you so much. One followup for perhaps ease of use.

I want to put this into an object and would like it to send the message to everyone except the owner.

So that no matter who I give the object to, once they rez it, it will only send an IM to others who touch it but not the owner.

Does that make sense?
_____________________
Unofficial moderator and proud dysfunctional parent to over 1000 bastard children.
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
07-28-2004 09:45
CODE

string szMessage = "I've got a feeeeeeeeling, so apeeeeeeeeeling";
default
{
touch_start(integer n)
{
if (llDetectedKey(0) != llGetOwner())
{
llInstantMessage(llDetectedKey(0),
szMessage);
}
}
}
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!