Jump to content

How to use llTeleportAgent in an experience


Pat Perth
 Share

You are about to reply to a thread that has been inactive for 2645 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I want to script an object so that if a visitor touches it, he/she gets teleported to a specific landmark. The function "llTeleportAgent()" does exactly this, but only if the object is owned by the toucher "unless part of an Experience." I cannot find in the discussion of experiences how you make this function "part of an Experience." Can anybody give me an example of how to do this?

Link to comment
Share on other sites

If you haven't read https://community.secondlife.com/t5/English-Knowledge-Base/Experiences-in-Second-Life/ta-p/2744686 as a starter, do that first.  That will explain how to create an Experience and set your land to be in it as a an Allowed or Key Experience.  Once you have done that, then setting any script in the Experience is simply a matter of checking the box at the bottom of the script editor window and selecting the name of your experience from the dropdown menu.  Once you save the script, it will be IN the Experience.

Link to comment
Share on other sites

Thank you. I have read all that. But what does being "in the experience" mean?

 

Does that mean it is not necessary to grant permission to execute llTeleportAgent() to to work, and it is not necessary to be owner of the object containing the script that calls llTeleportAgent() ? 

Link to comment
Share on other sites

Exactly.  Well, almost exactly.  You only ask the person permission once, as s/he enters the Experience.  Once a person has accepted the Experience, s/he never has to do it again, and you never have to ask for specific permission for most things (except PERMISSION_DEBIT and PERMISSION_OVERRIDE_ANIMATIONS and the land permission things).  You do have to perform the actions in an experience_permissions event, however.  So, for example, if you want to use llTeleportAgent when a person runs into a collision prim, you write something like

default{    collision_start(integer num)    {        llRequestExperiencePermissions(llDetectedKey(0),"");    }    experience_permissions (key Av)    {        llTeleportAgent(Av, "", <128,128,23>,ZERO_VECTOR);    }}

If the person has not already accepted the experience, s/he'll get a request dialog popup.  Otherwise, teleport will be automatic, since the person has already implicitly granted PERMISSION_TELEPORT.

You may want to look at this recent thread for a related discussion >>> https://community.secondlife.com/t5/LSL-Scripting/Questions-on-Experience/td-p/2946626

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2645 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...