Advertisement
Guest User

Sound thingy

a guest
Apr 23rd, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. float LOUDNESS = 1.0;
  2. //
  3. ////////////////////////////////////////////////
  4. default
  5. {
  6.  
  7. attach(key attached)
  8. {
  9. if (attached == NULL_KEY) return;
  10. //else
  11. //if (attached != NULL_KEY) return;
  12.  
  13. integer sounds = llGetInventoryNumber(INVENTORY_SOUND);
  14.  
  15. if ( sounds <= 0 ) return;
  16.  
  17. string soundname = llGetInventoryName( INVENTORY_SOUND, llFloor(llFrand(sounds)) );
  18. if ( soundname != "" )
  19. {
  20. llPlaySound( soundname, LOUDNESS );
  21. }
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement