• Winking Gwyn
  • Categories

  • Feeling generous today? Any money received will support the continued web hosting of this blog. Donate towards my web hosting bill!
  • Gwyneth Llewelyn is offline in Second Life.
  • Pages

  • Meta

  • Blog Rank: 124,475
  • Status Updates

    • [Blog] SL 2.0 Beta still running too slowly on your Mac? No worries!: If, like me, you're not the kind of person th... http://ping.fm/Y0gYX
      8 days ago
    • [Blog] The new possibilities of the XStreetSL "money API"?: I have to confess, I'm quite excited by the tremendous ... http://ping.fm/arSLj
      8 days ago
    • Yay, XStreetSL got some properly working CSS :) No more horizontal scroll bars... it's fluid now :)
      9 days ago
    • [Blog] Where is There?: Nowhere! http://ping.fm/khsS6
      10 days ago
    • Not There Any More: There.com shuts down its virtual world: http://ping.fm/wTCnW
      10 days ago
    • New simulator server software (1.36.4) seems to fix the problem with Estate Bans that didn't work: http://ping.fm/6Zr1W
      10 days ago
    • Call for speakers for the B2P 2010 Spring Conference "Leadership in Business" in #SL, promoted by @B2PBetaTech: http://ping.fm/DhXZT
      11 days ago
    • What a great idea: better integration of shared media and the UI on HUDs (adding transparency): http://ping.fm/FwJL6
      15 days ago
    • Our own @Doubledown_InSL hits CNN: http://ping.fm/W0aEK Congrats, DD! (Thanks for the link, @TrudyTakacs!)
      16 days ago
    • [Blog] On the Second Life 2.0 Viewer Revolution...: A few reasons why the SL 2.0 viewer will revolutionise Second L... http://ping.fm/xn3rY
      17 days ago
  • PostRank Topblogs 2009 - #16 in Virtual Worlds
  • RSS My Other Blog

02 Mar

Simple Door Script, with three states

This simple door script uses three states — “default”, to set the initial rotation, and “open” and “closed” to switch to that status. Note that the prim for the door needs to have Path Cut Begin at 0.375 and end at 0.875 for this to work.

It’s part of a series of LSL scripts I’m using for give some training courses on LSL :)

rotation rotInitial;

default
{
    state_entry()
    {
        rotInitial = llGetRot();
        state closed;
    }
}

state closed
{
    touch_start(integer total_number)
    {
        llSetRot(rotInitial * llEuler2Rot(<0, 0, PI_BY_TWO>));
        state open;
    }
}

state open
{
    touch_start(integer total_number)
    {
        llSetRot(rotInitial);
        state closed;
    }
}

Related posts:

  1. Generic llSitTarget Positioning Script
  2. Simple Intra-Simulator Teleporting Tool
  3. Simple Device To Give The Whole Inventory
  4. Simple slideshow projector
  5. Gwyn`s Colouriser Script

Related posts brought to you by Yet Another Related Posts Plugin.

  • Thank you, been looking at door scripts for ages and this one works a treat, I still don't like the path cut business but hey it works so thanks :)
blog comments powered by Disqus

© 2010 Gwyn’s Home | Entries (RSS) and Comments (RSS)

Powered by Wordpress, design by Web4 Sudoku, based on Pinkline by GPS Gazette