anti-no-script.lsl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // :CATEGORY:Transmogrify
  2. // :NAME:TransmogrifyAvatar
  3. // :AUTHOR:Ferd Frederix
  4. // :CREATED:2013-09-08
  5. // :EDITED:2014-01-01 12:18:57
  6. // :ID:921
  7. // :NUM:1322
  8. // :REV:1
  9. // :WORLD:Second Life
  10. // :DESCRIPTION:
  11. // for any prim so it works in no script zones
  12. // :CODE:
  13. // Script Name: Anti_no-script_script.lsl
  14. // Author: Ferd Frederix
  15. // Lets any attachment with scripts work in a no-script zone.
  16. // Downloaded from : http://www.outworldz.com/cgi/freescripts.plx?ID=1644
  17. // This program is free software; you can redistribute it and/or modify it.
  18. // Additional Licenes may apply that prevent you from selling this code
  19. // You must leave any author credits and any headers intact in any script you use or publish.
  20. ///////////////////////////////////////////////////////////////////////////////////////////////////
  21. // If you don't like these restrictions and licenses, then don't use these scripts.
  22. //////////////////////// ORIGINAL AUTHORS CODE BEGINS ////////////////////////////////////////////
  23. // The Script
  24. //
  25. //
  26. // ______ _ ______ _ _
  27. // | ___| | | | ___| | | (_)
  28. // | |_ ___ _ __ __| | | |_ _ __ ___ __| | ___ _ __ ___ __
  29. // | _/ _ \ '__/ _` | | _| '__/ _ \/ _` |/ _ \ '__| \ \/ /
  30. // | || __/ | | (_| | | | | | | __/ (_| | __/ | | |> <
  31. // \_| \___|_| \__,_| \_| |_| \___|\__,_|\___|_| |_/_/\_\
  32. //
  33. // fred@mitsi.com
  34. // author Ferd Frederix
  35. //
  36. // anti-no-script script
  37. // makes attached prims into a vehicle so they work in no-script zones.
  38. // If you attach the prim while in a no-script zone, it won't work. Fly up 50 meters or so and it will start.
  39. // Works only when in the root prim.
  40. default
  41. {
  42. state_entry()
  43. {
  44. llReleaseControls();
  45. llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS );
  46. }
  47. run_time_permissions(integer perm)
  48. {
  49. integer hasPerms = llGetPermissions();
  50. llTakeControls( 0 , FALSE, TRUE);
  51. }
  52. attach(key id)
  53. {
  54. if(id)//tests if it is a valid key and not NULL_KEY
  55. {
  56. llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS );
  57. }
  58. else
  59. {
  60. llReleaseControls(); // detached
  61. }
  62. }
  63. }