Advertisement
RuthvenWillenov

Change Texture when Under/Out of Water

Jun 9th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. default
  2. {
  3.     on_rez(integer n)
  4.     {
  5.         if(llGetAttached())
  6.         {
  7.             llSetTimerEvent(0.5);
  8.         }
  9.         else
  10.         {
  11.             llSetTimerEvent(0);
  12.         }
  13.     }
  14.    
  15.     timer()
  16.     {
  17.         vector pos = llGetPos();
  18.         float water = llWater(ZERO_VECTOR);
  19.         if(water > pos.z)//you are under water
  20.         {
  21.             llSetTexture("wet texture name/uuid",ALL_SIDES);
  22.         }
  23.         else
  24.         {
  25.             llSetTexture("dry texture name/uuid",ALL_SIDES);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement