Client

circle-exclamation

🚨 DO NOT CALL fjsf.draw3DTextRendered INSIDE A while true THREAD

draw3DText

fjsf.draw3DText(id, text, coords, data)

Draws a 3D text at given world coordinates.

This function must be called every frame to keep the text visible.


Parameters

  • id string Unique identifier of the text.

  • text string Text content displayed in the world.

  • coords vector3 World position of the text.

  • data table | nil Optional UI configuration passed to NUI.

    Supported fields:

    • backgroundColor string

    • textColor string


Returns

This function does not return anything.


Example


draw3DTextRendered

Registers a 3D text that is rendered automatically based on player distance.

The system handles:

  • Visibility checks

  • DUI allocation and reuse

  • Rendering updates

  • Interaction handling

This function should be called once.


Parameters

  • text string Text content displayed in the world.

  • coords vector3 World position of the text.

  • distance number Maximum distance at which the text is visible.

  • data table | nil Optional interaction and UI configuration.

    Supported fields:

    • backgroundColor string

    • textColor string

    • distInteract number β€” Interaction distance

    • keyNum number β€” Control ID

    • executeCommand string β€” Command executed on interaction

    • triggerEvent table

      • triggerName string

      • args table


Returns

  • string β€” Unique identifier of the created 3D text.


Example


remove3DText

Removes a 3D text created with fjsf.draw3DTextRendered.


Parameters

  • id string Identifier returned by fjsf.draw3DTextRendered.


Returns

This function does not return anything.


Example


Notes

  • draw3DText is frame-based and should be used only when needed.

  • draw3DTextRendered is optimized and recommended for most use cases.

  • The system reuses DUI objects internally (up to 200).

Last updated