Kartik Scripts

grantSurgery

Opens the surgery menu on a specific player, with no surgeon and every catalogue, cooldown, and gender rule waived.

๐Ÿ’ก Syntax

local ok, err = exports['kartik-clothing']:grantSurgery(target, opts)

๐Ÿ“ฅ Parameters

ParameterTypeOptionalDescription
targetnumberNoServer ID of the player to open the menu on.
optstableYesSession options, see below.

opts

KeyTypeDefaultDescription
pricenumber0Bank charge taken from the player on confirm. 0 is free.
tabsstring[]Config.PedSurgery.TabsTabs this visit may change: ped, heritage, face, hair, beard, makeup, skin, clothing, tattoos.
labelstringSurgeryMenu title shown to the player.
byCidstringadminCitizen ID recorded as the surgeon in kc_ped_surgeries.

๐Ÿ“ค Returns

TypeDescription
booleantrue if the menu was opened.
string?Error code when it was not: no_patient, patient_busy, or no_character.

๐Ÿ“ Example

-- Free full character re-edit, e.g. from a support ticket resource
local ok, err = exports['kartik-clothing']:grantSurgery(playerId, {
    price = 0,
    label = 'Character fix',
})

if not ok then
    print(('could not open surgery: %s'):format(err))
end
-- A paid clinic that only reshapes faces
exports['kartik-clothing']:grantSurgery(playerId, {
    price = 7500,
    tabs = { 'heritage', 'face' },
    label = 'Cosmetic Clinic',
})

[!NOTE] This ignores Config.PedSurgery.Enabled, so it works on servers that run no surgery roleplay.

[!WARNING] The caller is not checked. A server export is already inside the trust boundary, the resource calling it decides who is allowed to.

On this page