ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
client

DrawText / BeginTextCommandDisplayText

FiveM client native documentation with a Lua example.

Summary

Draws 2D text on screen. Must be called every frame while visible. Modern FiveM uses the BeginTextCommandDisplayText / EndTextCommandDisplayText pair.

Returns

void

Example

CreateThread(function()
  while true do
    Wait(0)
    SetTextScale(0.5, 0.5)
    SetTextFont(4)
    SetTextColour(255,255,255,255)
    BeginTextCommandDisplayText('STRING')
    AddTextComponentSubstringPlayerName('Hello')
    EndTextCommandDisplayText(0.5, 0.5)
  end
end)

Common pitfalls

  • Drawing natives MUST run every frame (Wait(0)) while the element is visible, or it flickers/disappears.
  • Only draw when needed (e.g. player near a point) — a permanent Wait(0) draw loop wastes performance.

Related natives

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 →