Skip to content

3D Interaction Text UI (Client) ​

Advanced proximity-based 3D interaction system. Creates floating prompts that appear when the player approaches a target (player, world coords, entity, or model).

Common options shape ​

lua
{
    id            = 'myInteraction',   -- unique ID within this group
    key           = 'E',               -- display key label
    keyNum        = 38,                -- GTA control index for this key
    displayDist   = 10.0,              -- distance to show the prompt
    interactDist  = 2.0,               -- distance to allow interaction
    text          = 'Interagér',       -- prompt text (optional)
    theme         = 'green',           -- 'green' | 'red'
    updateInterval = 250,              -- ms refresh rate while in range
    onSelect      = function(opt)      -- called when key is pressed
        -- opt contains the full option data
    end,
}

On-player interactions ​

lua
st.create3DTextUIOnPlayer(playerId, options)
st.update3DTextUIOnPlayer(playerId, optionId, data)
st.remove3DTextUIFromPlayer(playerId)
st.remove3DTextUIFromPlayerOption(playerId, optionId)

On-coordinate interactions ​

lua
-- Each option must include: coords = vector3(...)
st.create3DTextUIOnCoords(groupId, options)
st.update3DTextUIOnCoords(groupId, optionId, data)
st.remove3DTextUIFromCoords(groupId)
st.remove3DTextUIFromCoordsOption(groupId, optionId)

On-entity interactions ​

lua
-- Each option must include: entity = entityHandle
st.create3DTextUIOnEntity(groupId, options)
st.update3DTextUIOnEntity(groupId, optionId, data)
st.remove3DTextUIFromEntity(groupId)

On-model interactions ​

lua
-- Each option must include: model = 'prop_barrel_01a' (string or hash)
-- Applies to ALL entities of that model within range
st.create3DTextUIOnModel(groupId, options)
st.update3DTextUIOnModel(groupId, optionId, data)
st.remove3DTextUIFromModel(groupId)