How to save tattoos?
This page explains how you can save a player's tattoos to your database.
Depending on what your Config.useSkinchanger is set to, its a bit different how to get your tattoo object.
Config.useSkinchanger = false
If this is set to false, you can find the tattoo object in the skin object after a player has created his character. You can get them via skin.tattoos as you can see below
exports["nvx_charcreator"]:OpenCreator(function(skin)
if skin then
local tattoos = skin.tattoos
TriggerServerEvent("someEventToSaveYourTattoos", tattoos)
end
end)
On the server, the only thing you have to do is to encode the object with json.encode and store it in your database.
Config.useSkinchanger = true
If this is set to true, the tattoo object is returned as an extra parameter when the player finished creating his / her character.
exports["nvx_charcreator"]:OpenCreator(function(skinFormattedForSkinchanger, tattoos)
TriggerServerEvent("someEventToSaveYourTattoos", tattoos)
end)
Last updated