local function b(b)local O,I=pcall(function()return SocialService:CanSendGameInviteAsync(b)end)return O and I end button.Activated:Connect(function()local O=b(player)if O then local b,O=pcall(function()SocialService:PromptGameInvite(player)end)end end)

local function canSendGameInvite(sendingPlayer)
	local success, canSend = pcall(function()
		return SocialService:CanSendGameInviteAsync(sendingPlayer)
	end)
	return success and canSend
end

button.Activated:Connect(function()
	local canInvite = canSendGameInvite(player)
	if canInvite then
		local success, errorMessage = pcall(function()
			SocialService:PromptGameInvite(player)
		end)
	end
end)
