Kartik Scripts

Ped Surgery (In-Game Money)

Let players change their ped through surgery roleplay and pay with in-game bank money instead of a Tebex purchase. A surgeon performs the operation, the patient picks their new look, and the money goes to the surgeon's job account.

[!NOTE] Surgery never gives out peds that are sold on Tebex. Tebex peds still go through the normal Ped Changer.


🩺 How It Works

  [Surgeon targets a player] ──► [Enters a price]
                                        │
                                        ▼
  [Patient gets Accept / Decline] ──► [Accepts]
                                        │
                                        ▼
  [Ped Changer opens in surgery mode] ──► [Patient previews peds for free]
                                        │
                                        ▼
  [Patient confirms] ──► [Bank charged] ──► [Surgeon's job account paid]
  1. A player with a surgeon job who is on duty looks at another player and picks Perform surgery from the target menu.
  2. The surgeon types a price between MinPrice and MaxPrice.
  3. The patient gets a popup showing the surgeon's name and price, with Accept and Decline buttons.
  4. After accepting, the menu opens as Surgery - $price with every tab the server allows, by default that is the whole character: body, heritage, face, hair, beard, makeup, skin, clothing, and tattoos.
  5. The patient previews everything for free. Money is only taken when they confirm.
  6. The price comes out of the patient's bank and goes to the surgeon's job account (society), or to the surgeon's own bank if no banking script is running.

[!IMPORTANT] The one price covers every tab the surgery opened, and it is charged whether or not the patient changed their body. A patient who only reshapes their face still pays, billing on the model swap alone would hand them the rest of the visit for free.

[!TIP] The price and offer popups use ox_lib. The target option needs ox_target or qb-target.


⚙️ Configuration (shared/config_surgery.lua)

Surgery is off by default. Set Enabled = true to turn it on.

Config.PedSurgery = {
    Enabled = false,

    Jobs = { 'ambulance' },
    RequireOnDuty = true, -- set false if your server has no duty system

    MinPrice = 5000,
    MaxPrice = 100000,

    PayTo = 'society',    -- 'society' (falls back to surgeon's bank) or 'surgeon'
    SocietyAccount = nil, -- nil uses the surgeon's job name

    MaxDistance = 5.0,
    OfferTimeout = 30,    -- seconds to accept
    SessionTimeout = 600, -- seconds to choose and pay

    AllowGenderSwap = false,
    UseCooldown = true,   -- apply Config.PedChangeCooldown

    Tabs = {
        'ped', 'heritage', 'face', 'hair', 'beard', 'makeup', 'skin', 'clothing', 'tattoos',
    },
}
SettingDefaultDescription
EnabledfalseTurns surgery on or off.
Jobs{ 'ambulance' }Jobs allowed to perform surgery.
RequireOnDutytrueSurgeon must be on duty. Set false if your server has no duty system, or the option never shows.
MinPrice / MaxPrice5000 / 100000Price range the surgeon can charge.
PayTo'society''society' pays the job account (falls back to the surgeon's bank). 'surgeon' pays the surgeon directly.
SocietyAccountnilSociety account to pay. nil uses the surgeon's job name.
MaxDistance5.0How close the surgeon must be, checked when offering and again when the patient pays.
OfferTimeout30Seconds the patient has to accept.
SessionTimeout600Seconds the patient has to choose a ped and confirm.
AllowGenderSwapfalseAllow surgery to change to a ped of a different gender.
UseCooldowntrueApply Config.PedChangeCooldown from shared/config.lua to surgery too.
Tabsall nineWhat the patient may change once the surgery starts. See below.

🩹 What A Surgery Can Change

Tabs decides what the patient gets, in the order listed. Trim it to sell something narrower than a full re-edit.

TabOpens
pedThe model swap itself
heritageMother, father, third parent, skin tone, genetic mix
faceFace morph sliders and eye colour
hairHair style and colour
beardFacial hair, eyebrows and chest hair
makeupMakeup, blush, lipstick
skinBlemishes, ageing, complexion, sun damage, freckles, body blemishes
clothingThe full apparel wardrobe
tattoosEvery tattoo zone

An empty list falls back to { 'ped' }, and a name that doesn't match anything is skipped rather than breaking the menu.

[!TIP] Tabs needing a freemode body, heritage, face, beard, makeup, skin, are dropped automatically while a story ped is selected, since head blend and overlays do nothing on one.

Want a clinic that only does noses? Tabs = { 'face' }. A barber-surgeon hybrid? Tabs = { 'hair', 'beard', 'makeup' }.


🛠️ Giving One Player The Surgery Menu

Staff can open the surgery menu on a specific player directly, no surgeon, no offer to accept, and every catalogue, cooldown, and gender rule waived. This is the tool for fixing a character someone is stuck in.

/givesurgery 12                          -- free, all configured tabs
/givesurgery 12 5000                     -- charge $5000
/givesurgery 12 0 ped,heritage,face      -- only these tabs, free

It ignores Enabled, so it works even on a server that runs no surgery roleplay at all. See Session Commands and the grantSurgery export.


💾 Saving

A surgery always commits its result to the character, even on a server running inventory clothing items. A shop hands you garments to carry; a patient who paid a surgeon bought the result, not items.


🛡️ Rules & Protection

Everything is checked on the server, so a modified client can't get around it.

  • No Tebex peds: peds mapped to a Tebex package are never listed and are refused if requested, even if the patient owns them.
  • Pay on confirm only: previewing is free, and backing out costs nothing.
  • Surgeon must stay: the surgeon has to keep the job, stay on duty, and stay within MaxDistance until the patient pays.
  • No free staff surgery: admin bypass doesn't apply, so staff pay like everyone else.
  • No unlock used: surgery doesn't need or use a Tebex ped unlock.
  • Scope is server-side: the tab list comes from the server, so a modified client can't open tabs the surgery didn't sell.
  • Cooldown: with UseCooldown = true, a surgery counts as a ped change for the cooldown.
  • One at a time: a surgeon can run one surgery at a time, and a patient can have one offer at a time.

The surgery is cancelled, and the other player is told, when:

  • the patient declines or closes the menu without paying;
  • the offer or session times out;
  • either player leaves the server.

💬 Messages

SituationMessage
Price outside rangeThat price is outside the allowed range.
Too far awayThe patient is too far away.
Patient already has an offerThat patient already has a surgery offer.
Surgeon already busyYou already have a surgery in progress.
Patient has no character yetThat patient has no saved character yet.
Patient can't afford itYou need $price in the bank.
Surgeon left or moved awayYour surgeon is no longer with you.

🗄️ Database

Database TableDescription
kc_ped_surgeriesOne row per paid surgery: patient, surgeon, old and new model, price, and where the money went. Created automatically.
kc_ped_changesSurgery changes are also logged here with context surgery.

On this page