Pinksamurai

Random color changer

Jul 9th, 2018 (edited)
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //set a random color to all faces of the prim
  2. SetRanColor()
  3. {
  4.     llSetColor(<llFrand(1.0), llFrand(1.0), llFrand(1.0)> , ALL_SIDES);
  5. }
  6.  
  7. //Get the color vector of the clicked face
  8. GetFaceColor()
  9. {
  10.     llGetColor(llDetectedTouchFace(0));
  11. }
  12.  
  13. default
  14. {
  15.     state_entry()
  16.     {
  17.         llSetColor(<1.0, 1.0, 1.0>, ALL_SIDES);
  18.     }
  19.  
  20.     touch_start(integer total_number)
  21.     {
  22.         SetRanColor();
  23.         llSay(0, (string) GetFaceColor());
  24.     }
  25. }
Add Comment
Please, Sign In to add comment