Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Looking for a simple Touch script..

Silvio Canetti
Registered User
Join date: 30 Sep 2005
Posts: 10
08-15-2006 16:35
I'm looking for a simple touch script that will give the coordinates of an object when touched.

I make prefab homes, and am trying to create a system to setup teleporters for some homes that require them. I already have a teleport script, but the user must insert the coordinates for them upon placing the house. So I just want a simple script that I can place into another prim that they can sit out as a target, and click that to get the coordinates to place into the teleporters.

I'm sure it's a really easy script, and if I took the time to get into the scripting language, I could write it myself, but any help would be greatly appreciated :)
Silje Russell
lsl geek
Join date: 2 Oct 2005
Posts: 63
08-15-2006 17:02
CODE

default
{
touch_start(integer total_number)
{
vector pos = llGetPos();
integer x = (integer)pos.x;
integer y = (integer)pos.y;
integer z = (integer)pos.z;
llSetText("<"+(string)x+","+(string)y+","+(string)z+">",<1,0,1>,1);
llSay(0,"<"+(string)x+","+(string)y+","+(string)z+">");
}
}
_____________________
Yes i know i got typos..
I got writing and reading problems.
but i am still a humen!!
Xixao Dannunzio
Owner, X3D Enterprises
Join date: 20 Mar 2006
Posts: 114
08-15-2006 17:53
Or, much more simply:

CODE

default
{
touch_start(integer total_number)
{
llSay(0, (string)llGetPos());
}
}



With floating text:

CODE

default
{
touch_start(integer total_number)
{
llSetText((string)llGetPos(),<1,1,1>,1);
llSay(0, (string)llGetPos());
}
}