Cadburry ScriptsCadburry Scripts

Spawn

Quality of life scripts for your FiveM server. Performance optimized resources that install in minutes, with free updates and support that actually answers.

config/spawn.lua

lua
Config = Config or {}

---A single selectable spawn location.
---@class SpawnEntry
---@field label string display name shown in the spawn UI
---@field coords vector4 world position + heading
---@field requiredJob? string[] framework job names allowed to use this spawn

---A named group of spawn locations, shown as a category in the spawn UI.
---@class SpawnCategory
---@field label string
---@field spawns table<string, SpawnEntry>

---Effect played the moment a character is spawning
Config.SpawnEffect = {
    ---Master toggle for the whole effect.
    enabled = true,
    ---Screen postfx flashed as the camera pushes onto the ped (forge.plebmasters.de/animpostfx).
    postfx = 'SuccessNeutral',
    ---How long (ms) the post fx lingers before it is stopped.
    postfxDuration = 4000,
    ---Sound played on spawn
    sound = {
        enabled = true,
        file = 'fx_spawn.wav',
        volume = 0.9,
    },
    ---Expanding white sphere burst at the spawn point
    sphere = {
        enabled = true,
        dict = 'scr_rcbarry2',
        name = 'scr_alien_teleport',
        scale = 1.8,
    },
}

---Spawn locations grouped by category. Comment out a category's `spawns` to disable it.
---@type table<string, SpawnCategory>
Config.Spawn = {
    ['services'] = {
        label = 'Services',
        spawns = {
            ['paleto_medic'] = { label = 'Paleto Medical Center', coords = vector4(-22.05, 6525.35, 31.48, 224.3), requiredJob = {'ambulance'} },
            ['pillbox_medic'] = { label = 'Pillbox', coords = vector4(340.86, -632.89, 29.29, 349.67), requiredJob = {'ambulance'} },
            ['city_hall'] = { label = 'City Hall', coords = vector4(-565.37, -243.75, 36.72, 211.58) },
            ['court_house'] = { label = 'Court House', coords = vector4(220.98, -377.61, 44.41, 338.54) },
            ['mrpd'] = { label = 'Misson Row PD', coords = vector4(451.23, -934.58, 28.56, 167.25), requiredJob = {'police'} },
        }
    },
    ['sandy_shores'] = {
        label = 'Sandy Shores',
        spawns = {
            ['sandy_shores_fuel'] = { label = 'Fuel Station', coords = vector4(1989.74, 3779.19, 32.18, 119.08) },
        }
    },
    ['paleto'] = {
        label = 'Paleto',
        spawns = {
            ['paleto_bus_stand'] = { label = 'Paleto Bus Stand', coords = vector4(-217.25, 6191.2, 31.49, 229.57) },
        }
    },
    ['vinewood'] = {
        label = 'Vinewood',
        spawns = {
            ['taxi_stand'] = { label = 'Taxi Stand', coords = vector4(266.72, 146.19, 104.39, 339.44) },
            ['rockford_plaza'] = { label = 'Rockford Plaza', coords = vector4(-137.51, -251.71, 43.72, 252.26) }
        }
    },
    ['motels'] = {
        label = 'Motels',
        spawns = {
            ['pinkage'] = { label = 'Pinkage Motel', coords = vector4(325.05, -211.06, 54.09, 157.53) },
            ['themotor'] = { label = 'The Motor Motel', coords = vector4(1138.45, 2674.2, 38.19, 180.53) },
            ['dreamview'] = { label = 'Dream View Motel', coords = vector4(-104.68, 6308.51, 31.47, 313.17) },
        }
    },
    ['arrivals'] = {
        label = 'Arrivals',
        spawns = {
            ['lsia'] = { label = 'LSI Airport', coords = vector4(-1035.61, -2732.88, 20.17, 336.84) },
            ['alta_street'] = { label = 'Alta St. Train Station', coords = vector4(-206.35, -1014.33, 30.14, 338.11) },
            ['city_bus_station'] = { label = 'City Bus Stations', coords = vector4(449.94, -658.91, 28.46, 267.17) },
        }
    },
    ['del_perro_pier'] = {
        label = 'Del Perro Pier',
        spawns = {
            ['pier'] = { label = 'Amusement Park', coords = vector4(-1715.7, -1117.34, 13.15, 55.95) },
            ['beach_market'] = { label = 'Beach Market', coords = vector4(-1247.366, -1463.127, 4.263, 174.694) },
        }
    }
}
Last updated Cadburry Scripts