# SScriptingResources

**Members** 4

|          |                             |                                                                                  |
| -------- | --------------------------- | -------------------------------------------------------------------------------- |
| Function | [GetResource](#getresource) | Returns the SResource with the specified name, or else returns nil if not found. |
| Property | [Enabled](#enabled)         | Return whether the ScriptingResources component is Enabled or not                |
| Property | [Resources](#resources)     | Returns an array of all resources contained within this component.               |
| Property | [GameObject](#gameobject)   | –                                                                                |

## Functions

### GetResource

[SResource](/docs/scripting/client-scripting-api-reference/types/sresource.md) GetResource(string name)

Returns the SResource with the specified name, or else returns nil if not found.

Parameters

| Name | Type   | Default |
| ---- | ------ | ------- |
| name | string | –       |

Returns

`SResource`

Example

**Lua**

```lua
resource = Space.Host.ExecutingObject.Resources.GetResource("ResourceName")

```

**Lua**

```lua
local thisObject=Space.Host.ExecutingObject
local thisObjectResource=thisObject.Resources.GetResource("Test")
if thisObjectResource == nil then
    Space.Log("That resource was not found.")
else
    Space.Log("That resource exists and can be used.")
end

```

## Properties

### Enabled

bool Enabled {get; set; }

Return whether the ScriptingResources component is Enabled or not

Example

**Lua**

```lua
Space.Host.ExecutingObject.Resources.Enabled = true

```

### Resources

SResource\[] Resources {get; }

Returns an array of all resources contained within this component.

Example

**Lua**

```lua
arrayOfResources = Space.Host.ExecutingObject.Resources.Resources

```

### GameObject

[SGameObject](/docs/scripting/client-scripting-api-reference/types/sgameobject.md) GameObject {get; }

Example

**Lua**

```lua
theGameObject = Space.Host.ExecutingObject.Resources.GameObject

```
