Jump to content

Anton Hammerthall

Resident
  • Posts

    60
  • Joined

  • Last visited

Posts posted by Anton Hammerthall

  1. This is the script i made:

    default{    state_entry()    {         llSitTarget(<0.0,0.0,-0.6>, <0,-0.2,0,1>);    }        touch(integer num_detected)    {            if(llGetPermissions() & PERMISSION_CHANGE_LINKS)            {                llBreakLink(LINK_THIS);                //llOwnerSay("Delinked from prim");            }            //llOwnerSay("Touched");            if(llGetPermissions() & PERMISSION_ATTACH)            {                llAttachToAvatar(ATTACH_PELVIS); //if permission is set then attach                //llOwnerSay("Attach to avatar");            }    }        changed(integer change)    {        if(change &  CHANGED_LINK)        {            key av = llAvatarOnSitTarget();            if (av)             {                llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_CHANGE_LINKS  | PERMISSION_ATTACH | PERMISSION_TRIGGER_ANIMATION);                   }        }    }        run_time_permissions(integer perm)    {        if(perm & PERMISSION_ATTACH)        {             llOwnerSay("Attach set"); //for testing purposes        }        if(perm & PERMISSION_CHANGE_LINKS)        {             llOwnerSay("Link set"); //for testing purposes        }    }        attach(key Av)    {        integer perm = llGetPermissions();        if(Av)        {            llSetStatus(STATUS_PHYSICS , TRUE);             llStopAnimation("stand");            llStartAnimation("sit");            llOwnerSay("Attached"); //for testing purposes            llPushObject(Av, <0,0,50>, ZERO_VECTOR, FALSE);        }        else        {            llStopAnimation("sit"); //on drop/detach stop animation and die()            llStartAnimation("stand");            llDie();         }    }}

     It delinks the seat and attach to the pilot. The permissions wil be ask when the pilot gets in the seat 

     

  2. I have a problem with Requesting Permissions. Let me explain my self.

    I have a plane that is carrying a ejection seat. When you press a button the ejection seat will be placed in the world and attach to the player. The problem is that is requests permission to attach when the seat is rezzed. Is it possible to request permission when the player get in the plane?

    My skills with LSL are not very good but i can program in C so i understand the basics. I can post some scrips if needed :P

    Anton Hammerthall

×
×
  • Create New...