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
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
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)
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.