Advertisement
TheKeeper81

URL Giver

Jun 1st, 2025
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //URL Variables
  2. key TouchingAvatar = llDetectedKey(0);
  3. string PopUpInfo = "Join the official The School Of All Trades Discord server!";
  4. string URL = "https://discord.gg/n6cghUYzuH";
  5.  
  6. //Is the Avatar In The Same Region? True/False
  7. integer AvatarInSameRegion = (llGetAgentSize(id) != ZERO_VECTOR);
  8.  
  9. //Hover-Text Variables
  10. string HoverText = "Click For Discord Server";
  11. vector Color = <1.0, 1.0, 1.0>;
  12. float TextAlpha = 1.0;
  13.  
  14. default
  15. {
  16.     state_entry()
  17.     {
  18.         llSetText(HoverText, Color, TextAlpha);
  19.     }
  20.  
  21.     touch_start(integer total_number)
  22.     {
  23.         if (AvatarInSameRegion)
  24.         {
  25.             llLoadURL(TouchingAvatar, PopUpInfo, URL);
  26.         }
  27.         else
  28.         {
  29.            // If the agent is not in the same region, send a message instead
  30.            // The viewer will turn the URL clickable
  31.            llInstantMessage(TouchingAvatar, PopUpInfo + " " + URL);
  32.         }
  33.     }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement