Build and install
Installing on your server
Drop the folder into resources, add one line to server.cfg, restart and reconnect. Then switch to the ped with its chat command or use its model name.
What is in the zip
A Ped Creator zip holds one folder named after the ped: sws_mechanic for the example of these pages. It is a complete FiveM resource:
sws_mechanic/README.txt
sws_mechanic/client.lua
sws_mechanic/fxmanifest.lua
sws_mechanic/peds.meta
sws_mechanic/stream/sws_mechanic.ydd
sws_mechanic/stream/sws_mechanic.yft
sws_mechanic/stream/sws_mechanic.ymt
sws_mechanic/stream/sws_mechanic.ytdfxmanifest.luaRegisters peds.meta with the game and loads client.lua. Nothing to edit.client.luaThe test chat command. See Limit or remove the chat command below.peds.metaThe ped definition: male or female civilian template, walk style and voice slot.README.txtThe install steps, body type, ragdoll and height, and the warnings of the build as notes..yftThe skeleton, 128 bones, with the ragdoll..yddThe three body models, head, upper body and legs, with their distance models..ytdThe textures, one sheet per body model..ymtThe variation info: which model and texture each body part uses.
The manifest registers the ped with these lines:
fx_version 'cerulean'
game 'gta5'
files {
'peds.meta',
}
data_file 'PED_METADATA_FILE' 'peds.meta'
client_script 'client.lua'With Story Mode version on, a storymode folder sits next to the resource folder in the zip.
Install the resource
A Ped Creator ped installs like any other FiveM resource:
- 1
Unzip the download
Unzip
sws_mechanic.zip. You get the foldersws_mechanic. - 2
Copy it into resources
Put the whole folder into the
resourcesdirectory of your server. Keep the folder name;fxmanifest.luamust sit directly inside it. - 3
Add it to server.cfg
ensure sws_mechanic - 4
Restart and reconnect
Restart the server, then reconnect. New ped models are only picked up when a player connects, so players who stayed connected do not have the ped yet.
Note
No GTA ped is replaced. The ped is an add-on with its own model name, next to the vanilla peds.
Switch to the ped
Every Ped Creator resource has a test chat command named like the ped. Type /sws_mechanic in the chat, and your character turns into the ped.
- 1. ensure: the line for server.cfg
- 2. /sws_mechanic: turns you into the ped
The command loads the model, switches your player to it and puts on its default look. If the model is not loaded, it prints [sws_mechanic] model not found - is the resource started, and did you reconnect? in the F8 console.
In your own scripts, the ped name is the model name. It works wherever a ped model is expected:
Switch the player to the ped from any client script:
local model = joaat('sws_mechanic')
RequestModel(model)
while not HasModelLoaded(model) do Wait(0) end
SetPlayerModel(PlayerId(), model)
SetModelAsNoLongerNeeded(model)
SetPedDefaultComponentVariation(PlayerPedId())Spawn the ped as a character next to the player, from a client script:
local model = joaat('sws_mechanic')
RequestModel(model)
while not HasModelLoaded(model) do Wait(0) end
local pos = GetEntityCoords(PlayerPedId())
local ped = CreatePed(4, model, pos.x + 1.0, pos.y, pos.z - 1.0, 0.0, true, false)
SetModelAsNoLongerNeeded(model)Limit or remove the chat command
The chat command of a Ped Creator resource is registered for everyone, so any player on your server can turn into the ped. That is fine on a test server. On a live server, remove it or limit it to admins.
Delete client.lua from the folder, and delete this line from fxmanifest.lua:
client_script 'client.lua'The ped keeps working through its model name in scripts and ped menus.
Move the command to the server, where FiveM checks permissions. Replace the content of client.lua with this, so it waits for the server instead of the chat:
-- sws_mechanic: switches the player who asked to this ped.
local MODEL = 'sws_mechanic'
RegisterNetEvent('sws_mechanic:become', function()
local hash = joaat(MODEL)
if not IsModelInCdimage(hash) then
print('[sws_mechanic] model not found - is the resource started, and did you reconnect?')
return
end
RequestModel(hash)
local t = GetGameTimer()
while not HasModelLoaded(hash) do
if GetGameTimer() - t > 10000 then print('[sws_mechanic] model load timeout') return end
Wait(50)
end
SetPlayerModel(PlayerId(), hash)
SetModelAsNoLongerNeeded(hash)
SetPedDefaultComponentVariation(PlayerPedId())
end)Create server.lua in the same folder with the restricted command:
RegisterCommand('sws_mechanic', function(source)
TriggerClientEvent('sws_mechanic:become', source)
end, true)Add this line to fxmanifest.lua:
server_script 'server.lua'Then allow the command for your admin group in server.cfg:
add_ace group.admin command.sws_mechanic allowOnly players in group.admin can use /sws_mechanic now. Use the group your server already gives its admins.
Add-on ped, not freemode
A Ped Creator ped is an add-on ped, like the GTA civilians. It is not one of the two freemode peds, mp_m_freemode_01 and mp_f_freemode_01, that FiveM characters are usually built on.
- It has one fixed look: the model, the textures and the materials you built. There are no clothing or hair variations.
- Clothing shops, barbers, head blend and character creators only work on the freemode peds. On your ped they change nothing.
- Frameworks that put the saved freemode look back on spawn switch the player back. Use a ped menu or your own script to give the ped.
Weapons, emotes, vehicles and every vanilla animation work, because the skeleton is the one the freemode peds use.
Story Mode
With Story Mode version on, the Ped Creator also packs the ped as a single-player DLC. It sits in the storymode folder of the zip, with its own INSTALL.txt.
- 1
Prepare OpenIV
You need OpenIV with a
modsfolder, plus the ASI Loader andOpenIV.asi. OpenIV installs both under Tools, ASI Manager. - 2
Copy the DLC
Copy the folder
dlcpacks/sws_mechanic, withdlc.rpfinside, intoGTA V/mods/update/x64/dlcpacks/. - 3
Add it to dlclist.xml
In OpenIV, Edit mode, open
mods/update/update.rpf/common/data/dlclist.xml. Add this line inside<Paths>and keep the lines that are there. The line is also indlclist-add-line.txt.<Item>dlcpacks:/sws_mechanic/</Item> - 4
Load it with a trainer
Start Story Mode and switch to the model by name. In Menyoo: Player Options, Model Changer, Input Model, then
sws_mechanic.
To uninstall, remove the line from dlclist.xml and delete the folder.
Careful
Built for GTA V Legacy; GTA V Enhanced is not tested. The Story Mode version is newer than the FiveM resource and less tested in game.
Several peds on one server
Each Ped Creator ped is its own resource with its own model name, so any number can run on one server. Add one ensure line per ped.
Keep them as separate resources. The Resource Merger does not take peds, because each one registers its own peds.meta.
Examples, pricing and FAQ on the FiveM Ped Creator page.