> For the complete documentation index, see [llms.txt](https://grp-development.gitbook.io/solid-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://grp-development.gitbook.io/solid-scripts/resources/solid-shellcreator/developer-edits.md).

# Developer edits

Open hooks before and after every shell action.

`edits/sv_edits.lua` and `edits/cl_edits.lua` stay open. Every function in them is empty: leave it empty and the script works as normal, or write your own code. A **Before** function can return `false, 'your reason'` to stop the action. Other resources can add the server hooks with the `AddHook` export.

{% hint style="info" %}
If your code has an error, it is printed in the console and the script keeps working as normal.
{% endhint %}

#### Server (sv\_edits.lua)

| Function            | Arguments                                                 | Return                       |
| ------------------- | --------------------------------------------------------- | ---------------------------- |
| `BeforeEnterShell`  | source, data (shell, label, instance, teleporter)         | `false, reason` to block     |
| `AfterEnterShell`   | source, data (shell, label, instance, bucket, teleporter) |                              |
| `AfterExitShell`    | source, data (shell, instance, teleporter)                |                              |
| `CanUseTeleporter`  | source, teleporter, allowed                               | `true` / `false` to override |
| `BeforeEditShell`   | source, shell                                             | `false, reason` to block     |
| `AfterPublishShell` | source, shell (id, name, label, revision)                 |                              |
| `AfterDeleteShell`  | source, shell (id, name, label)                           |                              |
| `OnAdminAction`     | source, action, data                                      |                              |

#### Client (cl\_edits.lua)

| Function                         | Arguments                           | Return                                   |
| -------------------------------- | ----------------------------------- | ---------------------------------------- |
| `OnEnterShell`                   | shell (id, label, instance), handle |                                          |
| `OnExitShell`                    | shell (id, label, instance)         |                                          |
| `OnEditorOpen` / `OnEditorClose` | shell (id, label)                   |                                          |
| `DrawMarker`                     | teleporter, coords                  | `true` when you drew your own marker     |
| `ShowTeleporter`                 | teleporter                          | `false` to hide the door for this player |

```lua
Config.SvEdits.BeforeEnterShell = function(source, data)
    if IsHandcuffed(source) then return false, 'You are cuffed' end
end
```
