Any way to detect when someone invites using InvitePrompt of SocialService

Currently working on a game and I want to boost the game by rewarding players when they invite one of their Roblox friend using the following GUI.

GUI

image

I’ve tried using SocialService.PromptInviteRequested but it just throws some random messy roact error. Then on the Developer page I found out that it can only be accessed by CoreScripts. So my guess so far is, it’s not possible.

But, around a year ago I had seen a game rewarding players for inviting using the GUI, even saw some YouTube videos on the fact. What I’m trying is, to detect whenever someone actually presses the invite button on the GUI.

THe only way you can do so form my knowledge is to use GameInvitePromptClosed and use the 2nd return, which is an array of userids of the users the player invited, you can check if there’s something i nthe table via the # operator and reward if ther eis

1 Like

Thanks for your response. I just tried printing the array in output but it seems to return nil everytime. What am I doing wrong? This is a server script located in ServerScriptService.

local SocialService = game:GetService("SocialService")
-- local plr = game.Players.LocalPlayer
-- local InviteAmount = 0

SocialService.GameInvitePromptClosed:Connect(function(plr, invited)
    print(plr.Name)
    print(invited)
end)

https://gyazo.com/0f4df11def703b5374158115877d8a54

Odd, could you using it locally instead of from the server and see if that does anything?

I had tried that earlier (That’s why the plr variable is commented) and the result was the same. :neutral_face:

might be becuz youre on studio try it in a live game and see what happens

Tried debugging in roblox. Had to use for loop since in game, I cannot see the table. And it printed nothing.

I think this feature was disabled because it was abused to make users spam people. Will try to find a source.

1 Like

Found the source: [ENABLED as of May 28] SocialService Game Invites are Live - #185 by be_nj

We’ve made the decision to change the GameInvitePromptClosed event to only return an empty table. We still want to support all of the usecases originally intended for the feature, however these features will require larger changes if we wish to properly support them in a responsible and healthy manner.

1 Like