ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
QBCoreserver

Player.Functions.SetMetaData

QBCore server documentation with a FiveM Lua example.

Summary

Sets a metadata value on a QBCore player (hunger, thirst, stress, etc.). The standard way to update status and custom player attributes.

Returns

void

Parameters

keystringThe metadata key (e.g. 'hunger').
valueanyThe value to set.

Example

local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.SetMetaData('hunger', 100)

Common pitfalls

  • Read current values via Player.PlayerData.metadata.
  • Do status logic server-side; don't trust client values.
  • Sync to the client if your HUD reads it.

Related functions

Related guides

FiveM scripts done right

Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.

Browse Scripts →