Want to change the default spawnpoints or add new ones? Managing spawnpoints in the QBCore Framework is done via the qb-spawn resource. Below, you'll learn how to customize them.
Spawnpoints are set in the config.lua configuration file of the qb-spawn resource. You can edit this file via FTP. If you’re not familiar with FTP yet, we recommend checking out our FTP Access guide.
The default spawnpoint configuration looks like this:
QB.Spawns = {
["legion"] = { -- Index for the table
coords = vector4(195.17, -933.77, 29.7, 144.5), -- Where the player spawns
location = "legion", -- So the JavaScript knows which spawn you chose
label = "Legion Square", -- What the player sees in the menu
},
["policedp"] = {
coords = vector4(428.23, -984.28, 29.76, 3.5),
location = "policedp",
label = "Police Department",
},
["paleto"] = {
coords = vector4(80.35, 6424.12, 31.67, 45.5),
location = "paleto",
label = "Paleto Bay",
},
["motel"] = {
coords = vector4(327.56, -205.08, 53.08, 163.5),
location = "motel",
label = "Motels",
},
If you want to add more spawnpoints, simply add another entry in the configuration file:
["new_spawn_name"] = { -- Must be unique
coords = vector4(1.1, -1.1, 1.1, 180.0), -- Coordinates where the player spawns
location = "new_spawn_name", -- Must be unique
label = "New spawn name", -- The label shown in the selection menu
},
Determining coordinates You need a suitable resource to find the current coordinates. You can find several tools online; just pick the one that suits you best. :)
The final result looks like this:
QB.Spawns = {
["legion"] = { -- Index for the table
coords = vector4(195.17, -933.77, 29.7, 144.5), -- Where the player spawns
location = "legion", -- So the JavaScript knows which spawn you chose
label = "Legion Square", -- What the player sees in the menu
},
["policedp"] = {
coords = vector4(428.23, -984.28, 29.76, 3.5),
location = "policedp",
label = "Police Department",
},
["paleto"] = {
coords = vector4(80.35, 6424.12, 31.67, 45.5),
location = "paleto",
label = "Paleto Bay",
},
["motel"] = {
coords = vector4(327.56, -205.08, 53.08, 163.5),
location = "motel",
label = "Motels",
},
["new_spawn_name"] = { -- Must be unique
coords = vector4(1.1, -1.1, 1.1, 180.0), -- Coordinates where the player spawns
location = "new_spawn_name", -- Must be unique
label = "New spawn name", -- The label shown in the selection menu
},
}