Collapse Sidebar


This event is a signal invoked when a player has closed the game invite prompt and batches all users and conversation participants into a single array. This prompt can be prompted by the developer or accessed from the SettingsHub menu.

How Game Invites Work

  • User joins a game and presses a developer-constructed button. Activating the button will invoke SocialService/PromptGameInvite|PromptGameInvite(localPlayer).
  • 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:
  • When the user successfully sends an invite, a rbx::signal will fire on the client and server (called SocialService.PromptInviteRequested).

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/PromptGameInvite, prompts the specified player with the game invite screen
  • SocialService/CanSendGameInviteAsync, returns true or false depending on the user


Name Type Default Description

The player instance who has closed the prompt

An array of ids that have received a game invite when the prompt was opened

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 button = script.Parent

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

local function promptGameInvite(targetPlayer)
	local res, canInvite = pcall(SocialService.PromptGameInvite, SocialService, 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
	button.Visible = false

local function onActivated()


-- Hide the button until we've checked that the player can send game invites
button.Visible = false
button.Visible = canSendGameInvite(player)