BaconsOwnTheUniverse

Invite friends GUI Script [ROBLOX Studio]

Aug 3rd, 2021
659
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local button = script.Parent
  2. local SocialService = game:GetService("SocialService")
  3. local player = game.Players.LocalPlayer
  4.  
  5. function onButtonPressed()
  6.     local success, result = pcall(
  7.         function()
  8.             return SocialService:CanSendGameInviteAsync(player)
  9.         end
  10.     )
  11.     if result == true then
  12.         SocialService:PromptGameInvite(player)
  13.     end
  14. end
  15.  
  16. button.MouseButton1Click:Connect(onButtonPressed)
  17. button.TouchTap:Connect(onButtonPressed)
RAW Paste Data