SocialService.GameInvitePromptClosed always returns an empty table

Hello everyone! I want to implement a feature in my game that for every user a Player invites he gets a few ‘Coins’ (Currency in my game).
I wanted to test the SocialService’s GameInvitePromptClosed function with this slightly modified sample Code from SocialService | Documentation - Roblox Creator Hub

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

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

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

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

local function invitePromptClosed(senderPlayer, recipientIds)
– Handle custom logic for players invited by sender
print(senderPlayer.Name…" invited “…#recipientIds…” users!")
for i,v in pairs(recipientIds) do–Prints every UserId the player invited
print(v)
end
end

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
	openGameInvitePrompt(player)
end

end

script.Parent.InputBegan:Connect(inputBegan)
SocialService.GameInvitePromptClosed:Connect(invitePromptClosed)

When I’m testing it the Invite friend menu opens as exspected and I can invite my Friends.
When I close it I get this Output:

  Sonnenroboter invited 0 users!

This is not exspected because I invited a lot of People but the table is still empty.

This appears to be intended behavior.

Oh, thanks for the Info!

RIP idea of giving users coins for inviting People…

1 Like

This topic was automatically closed after 13 minutes. New replies are no longer allowed.