Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Through Wall Teleporter (Group Only)...

Stone Saenz
Owner, The Landing Strip
Join date: 14 Mar 2007
Posts: 8
07-19-2007 21:38
I have perused the groups and taken bits and pieces for the script I'm working on. I know I'm very close, but I can't seem to figure out what I'm doing wrong! Even if my tag is off, I still can TP through, but won't unsit me. Could you guys please take a look and tell me what I'm doing wrong, please?

Thank you much!! =-]

teleport()
{
//Teleport 5 meters through the wall onto the other side. Sleep/unsit.
llSitTarget(<5, 0, 0>, ZERO_ROTATION);
llSleep(0.15);
llUnSit(llAvatarOnSitTarget());
}

init()
{
//Initialize the prim settings
llSetSitText("Teleport";);
llSetText("", <1,1,1>, 1);
}

default
{
state_entry()
{
init();
llWhisper(0, "Teleporter Initialized.";);
}

touch_start(integer total_number)
{
integer i;

//Cycle through all "touchers" in case there is more than one.
for ( i = 0 ; i < total_number ; ++i )
{
//Check group membership before executing the TP
if (llDetectedGroup(i) && ! llSameGroup(NULL_KEY))
{
llSay(0, "Passed";);
teleport();
}
else
{
// if not, tell them to activate their tag if they SHOULD have access...
llSay(0, "Group members only, sorry.";);
llSay(0, "If you are a group member, please \"wear your tags\" by making the group active..";);
llUnSit(llAvatarOnSitTarget());
llUnSit(llAvatarOnSitTarget());
}
}
}
}
Kidd Krasner
Registered User
Join date: 1 Jan 2007
Posts: 1,938
07-20-2007 00:12
It looks like you're not resetting the sit target back to the original starting point.
Simnelia Petrichor
Registered User
Join date: 10 Feb 2006
Posts: 35
07-20-2007 01:40
Also, the UnSit() function is being run when someone clicks on the object rather than when someone sits on it. For that, you can use the changed event, eg:

changed(integer change)
{
if (change & CHANGED_LINK)
{
if (llAvatarOnSitTarget() != NULL_KEY)
{
llSleep(0.15);
llUnSit(llAvatarOnSitTarget());
}
}
}
Stone Saenz
Owner, The Landing Strip
Join date: 14 Mar 2007
Posts: 8
07-20-2007 10:55
Thank you for your replies. I think my biggest problem is that since I had set the object to sit on left-click, I assumed the touch event actually took place. It never does. How would I run the check against the person sitting from inside the Change event? Should this be where I make the group check?

Thank you.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
07-20-2007 10:58
From: Stone Saenz
Thank you for your replies. I think my biggest problem is that since I had set the object to sit on left-click, I assumed the touch event actually took place. It never does. How would I run the check against the person sitting from inside the Change event? Should this be where I make the group check?

Thank you.


well, the problem with a secure teleporter and using a sit-target teleporter is that as soon as you're seated, your avatar is moved. with the new llSetLinkPrimitiveParams() command what you can do is run your check to see if the avatar is in the group, and if not, set the avatar's link position back to the location of the root prim before unseating them. Other wise, I'd reccomend going with a warppos() based teleporter. with that when an avatar is seated, you do the group check. if they are not in the group, then you unseat them. if they are, then you run the warppos() call and then unseat them.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Stone Saenz
Owner, The Landing Strip
Join date: 14 Mar 2007
Posts: 8
07-20-2007 12:59
Ahhh! Yet ANOTHER function to research! hehehe... Thank you very much for this nudge. =-]