ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
QBCoreserver

Player.Functions.SetJob

QBCore server documentation with a FiveM Lua example.

Summary

Sets a player's job and grade. The standard way to change jobs in QBCore, used by job centers and admin tools.

Returns

boolean

Parameters

jobstringThe job name (must exist in shared jobs).
gradenumberThe grade level.

Example

local Player = QBCore.Functions.GetPlayer(src)
if Player then
  Player.Functions.SetJob('police', 2)
end

Common pitfalls

  • The job must be defined in QBCore shared jobs, or it fails.
  • Grade is the numeric level — make sure it exists for that job.
  • This is a good example of logic a multijob script wraps for the player.

Related functions

Related guides

Managing jobs on your server?

Viper Multi-Job lets players hold several jobs and switch between them with grade, salary and duty handled — QBCore, QBox and ESX, validated server-side.

See Viper Multi-Job →