We use cookies on this site to enhance your user experience
Collapse Sidebar


This function will invoke a Reflected RobloxScriptSecurity only event SocialService/PromptInviteRequested.

The targetPlayer will be shown a modal invite screen. It can error if targetPlayer is not in the datamodel.

How Game Invites Work

  • User joins a game and presses a developer-constructed button. Activating the button will invoke PromptGameInvite(localPlayer).

Step 1

  • This function call will fire a DataType/RBXScriptSignal|rbx::signal (called SocialService/PromptInviteRequested). The CoreScript|CoreScripts are bound to this signal through Reflection and once invoked will show the user a version of the following screen:

Step 2

  • When the user successfully sends an invite, a rbx::signal will fire on the client and server (called SocialService.PromptInviteRequested).

Step 3

See also

This is part of the SocialService class containing a set of APIs that allow you to integrate game invitations into your games.

  • SocialService/GameInvitePromptClosed, fires when a player closes a game invite prompt
  • SocialService/CanSendGameInviteAsync, returns true or false depending on the user


Name Type Default Description

The player to prompt with the game invite screen


Return Type Summary

No return

Code Samples

Sending a Game Invite

The following code sample demonstrates how to implement several SocialService APIs to allow players to invite other players to your game.

In order to work as expected, the code sample must be placed in a LocalScript descending from a GuiButton. When the Players/LocalPlayer touches or left clicks the GUI button, it executes openGameInvitePrompt() which opens the game invite prompt using SocialService/PromptGameInvite after firing canSendGameInvite() to check if the player can send game invites using SocialService/CanSendGameInviteAsync.

When the player closes the invite prompt, the invitePromptClosed() function connected to the SocialService/GameInvitePromptClosedevent fires.

local SocialService = game:GetService(“SocialService”)
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer

local function canSendGameInvite(targetPlayer)
	local res, canSend = pcall(SocialService:CanSendGameInvite(targetPlayer))
	return res and canSend

local function promptGameInvite(targetPlayer)
	local res, canInvite = pcall(PromptGameInvite(targetPlayer))
	return res and canInvite

local function openGameInvitePrompt(targetPlayer)
	local canInvite = canSendGameInvite(targetPlayer)
	if canInvite then
		local promptOpened = promptGameInvite(targetPlayer)
		return promptOpened
	return false

local function invitePromptClosed(senderPlayer, recipientIds)
	-- Handle custom logic for players invited by sender

local function inputBegan(input, gameProcessed)
	local inputType = input.UserInputType
	local touch = Enum.UserInputType.Touch
	local mouse1 = Enum.UserInputType.MouseButton1

	if inputType == touch or inputType == mouse1 then