Advertisement
BaconsOwnTheUniverse

Invite friends GUI Script [ROBLOX Studio]

Aug 3rd, 2021
2,034
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement