Advertisement
Shrike7734

Untitled

Feb 7th, 2025
1,643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. default
  2. {
  3.     state_entry()
  4.     {
  5.         llSetLinkPrimitiveParamsFast(LINK_SET_TEXTURE, ALL_SIDES, <0.0, 0.0, 0.0, 0.0>); // Make the avatar invisible
  6.     }
  7.  
  8.     on_rez(integer start_param)
  9.     {
  10.         llSetLinkPrimitiveParamsFast(LINK_SET_TEXTURE, ALL_SIDES, <0.0, 0.0, 0.0, 0.0>); // Make the avatar invisible
  11.     }
  12.  
  13.     // This function is called when the avatar collides with an object.
  14.     // We use this to check if the object is a wall and allow the avatar to pass through it.
  15.     collision_start(integer num_detected) list detected_pos, list detected_rot, list detected_vel, list detected_key)
  16.     {
  17.         for (integer i = 0; i < num_detected; i++)
  18.         {
  19.             key objectKey = detected_key[i];
  20.             vector objectPos = detected_pos[i];
  21.            
  22.             // Check if the object is a wall. You can adjust this check based on your needs.
  23.             if (llGetLinkPrimitiveParamsFast(objectKey, LINK_PRIM_TYPE) == PRIM_TYPE_BOX)
  24.             {
  25.                 llSetLinkPrimitiveParamsFast(LINK_SET_TEXTURE, ALL_SIDES, <0.0, 0.0, 0.0, 0.0>); // Make the avatar invisible for a short duration
  26.                 llSleep(0.1); // Wait for a short time
  27.                 llSetLinkPrimitiveParamsFast(LINK_SET_TEXTURE, ALL_SIDES, <1.0, 1.0, 1.0, 1.0>); // Make the avatar visible again
  28.                 llSetPos(objectPos + <0, 0, 1>); // Move the avatar slightly forward to avoid getting stuck
  29.             }
  30.         }
  31.     }
  32. }
Tags: secondlife
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement