# sm.uuid.new

Creates a uuid from a string or generates a random uuid (version 4).

**Kind:** Function

**Environments:** Game, Terrain

## Game

### Game overload 1

``` { .lua .api-signature }
sm.uuid.new( uuid? )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.uuid.md#new-uuid-optional)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` *(optional)* | [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The uuid to create a uuid instance from. If none is provided, generate a random uuid. |

**Returns:**

| Type | Description |
| --- | --- |
| [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The created uuid. |

### Game overload 2

``` { .lua .api-signature }
sm.uuid.new( uuid? )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.uuid.md#new-string-optional)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` *(optional)* | string | The uuid string to create a uuid instance from. If none is provided, generate a random uuid. |

**Returns:**

| Type | Description |
| --- | --- |
| [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The created uuid. |

## Terrain

### Terrain overload 1

``` { .lua .api-signature }
sm.uuid.new( uuid? )
```

[Open the full Terrain reference](../Terrain-Script-Environment/Static-Functions/sm.uuid.md#new-uuid-optional)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` *(optional)* | [Uuid](../Terrain-Script-Environment/Userdata/Uuid.md) | The uuid to create a uuid instance from. If none is provided, generate a random uuid. |

**Returns:**

| Type | Description |
| --- | --- |
| [Uuid](../Terrain-Script-Environment/Userdata/Uuid.md) | The created uuid. |

### Terrain overload 2

``` { .lua .api-signature }
sm.uuid.new( uuid? )
```

[Open the full Terrain reference](../Terrain-Script-Environment/Static-Functions/sm.uuid.md#new-string-optional)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `uuid` *(optional)* | string | The uuid string to create a uuid instance from. If none is provided, generate a random uuid. |

**Returns:**

| Type | Description |
| --- | --- |
| [Uuid](../Terrain-Script-Environment/Userdata/Uuid.md) | The created uuid. |
