SocialService Spamming Output

I have a script for TopBarPlus that displays the “Invite Friends” Menu using SocialService.

The script works fine. The issue is that the output is spamming with these errors:


Can someone tell me what I’m doing wrong?

Here’s the script:

local Icon = require(game:GetService("ReplicatedStorage").Icon)
local SocialService = game:GetService("SocialService")
local Player = game.Players.LocalPlayer
local icon = Icon.new()

:setLabel("Invite Friends", "deselected")
:setLabel("Open", "selected")
:setCaption("Invite your friends to join!")

local function onButtonPressed()
	local success, result = pcall(
		function()
			return SocialService:CanSendGameInviteAsync(Player)
		end
	)

	if result == true then
		SocialService:PromptGameInvite(Player)
	end
end

icon.selected:Connect(function()
	onButtonPressed()
	icon:deselect()
end)

I get the same result when I use this with a button instead of TopBarPlus as well.

I also saw that on my game. I think that is an Roblox issue, because we can’t control these scripts.

It’s a bug? Well that stinks. Has someone already created a bug report on it? I’d like to show my support to it. :slight_smile:

Multiple SocialService Features Broken It’s already there

Thank you.