> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-tattoo/developers.md).

# For developers

Exports and events of CAS Advanced Tattoo System for RedM: read a character's tattoos, put them back on after another script rebuilds the ped, add head layers.

## Exports

* Server: `exports["cas-tattoo"]:GetTattoos(source)` returns the character's list `{ d = design, s = spot, i1, i2 }`.
* Server: `exports["cas-tattoo"]:IsArtistOnDuty(source)`.
* Client: `exports["cas-tattoo"]:Refresh()` puts the tattoos back on (call it after your script rebuilds the ped).
* Client: `exports["cas-tattoo"]:AddHeadLayers(textureId)` adds the face and neck tattoos to a head texture your creator is building; the event `cas-tattoo:client:headChanged` asks it to build the face again (see [Face, neck and head](/script-documentation/cas-tattoo/head.md)).

## Keeping the tattoos on

The tattoos live in the body texture, so a script that rebuilds the character can drop them. cas-tattoo puts them back by itself when the body drawable changes (clothes on and off, a revive, a model change), when a character is selected and on VORP's skin reload event. If a clothing or barber script of yours rebuilds the body without any of that, call the client export above, set `Config.RefreshSeconds`, or players can type `/tattoos`.

## Logs

Every tattoo, removal and admin change goes to the server console, and to a Discord webhook when `Config.Log.webhook` is set.

## Adding designs

The textures are baked from flash art with the tools that come with the source: `cut_flash.py` splits a flash sheet into designs, `bake.py` places every design on Rockstar's tattoo zone space and writes the textures and `shared/textures.lua`. Contact us for new designs or a custom flash set.
