> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markz3d.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SetSafeEnabled

Enables or disables a safe. A disabled safe is removed from the world but kept in the database (code, jobs and position are preserved) and stays removed after a restart, enabling it recreates it.

<table>
  <thead>
    <tr>
      <th scope="col">
        Argument
      </th>

      <th scope="col">
        Data Type
      </th>

      <th scope="col">
        Needed
      </th>

      <th scope="col">
        Default
      </th>

      <th scope="col">
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <th>`safe_id`</th>
      <td>string</td>
      <td>✅</td>
      <td>`-`</td>
      <td>The id of the safe</td>
    </tr>

    <tr>
      <th>`enabled`</th>
      <td>boolean</td>
      <td>✅</td>
      <td>`-`</td>
      <td>True to recreate the safe, false to remove it from the world</td>
    </tr>
  </tbody>
</table>

> **Returns**
>
> <table>
>   <thead>
>     <tr>
>       <th scope="col">
>         Type
>       </th>
>
>       <th scope="col">
>         Description
>       </th>
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr>
>       <td>boolean</td>
>
>       <td>
>         true if the safe status has been updated, false otherwise
>       </td>
>     </tr>
>
>     <tr>
>       <td>string | nil</td>
>
>       <td>
>         The error message if the status has not been updated (`Safe not found`)
>       </td>
>     </tr>
>   </tbody>
> </table>

> **Example**
>
> ```lua theme={null}
> exports["mxc_safe"]:SetSafeEnabled(safeId, false)
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.