GameInvitePromptClosed
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
(calledSocialService/PromptInviteRequested
). TheCoreScript|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 screenSocialService/CanSendGameInviteAsync
, returns true or false depending on the user
Parameters
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/GameInvitePromptClosed
event fires.