# ServiceProvider

ServiceProvider : `Instance`

## Overview

An abstract base class that returns service Objects such as Workspace or Players

## Properties

## Methods

### FindService

If a service with the specified name exists, it returns that service.

If the name is incorrect or the service hasn't been created yet, an error will occur.

#### Parameters

| `string` InClassName | The class name of the service to retrieve. |
| -------------------- | ------------------------------------------ |

#### Return

| `Instance` |   |
| ---------- | - |

#### Code Samples

```lua
local Workspace = game:FindService("Workspace")
local InvalidService = game:FindService("InvalidService")
```

### GetService

If a service with the specified name exists, it returns that service.

If the provided name corresponds to a valid service, it returns the service if it already exists; if not, the service is automatically created and returned.

#### Parameters

| `string` InClassName | The class name of the service to retrieve. |
| -------------------- | ------------------------------------------ |

#### Return

| `Instance` |   |
| ---------- | - |

#### Code Samples

```lua
local Players = game:GetService("Players") 
local Workspace = game:GetService("Workspace")
```

## Events

## See also

{% content-ref url="../../../manual/script-manual/get-started/object-reference" %}
[object-reference](https://docs.overdare.com/manual/script-manual/get-started/object-reference)
{% endcontent-ref %}
