3D Text UI
3D Text UI is a module for creating interactive text displays in 3D space.
Player 3D Text UI
st.create3DTextUIOnPlayer()
Creates a 3D text UI attached to a player.
Syntax
st.create3DTextUIOnPlayer(id, options)Parameters
id : string
The id of the options category
options : table
option: object
id: integer - The unique id of the optionstext: string - The text which is shown when in interact distancedisplayDist: integer - The distance before the pin marker is showninteractDist: integer - The distance before the interaction is shownkey: string - The display key for the interactionkeyNum: integer - The actual key listener the script will listen to.player: integer - The player server idbone: string - The bone of the entityOptionalonSelect: function - The function triggered when the interaction is selectedcanInteract: function - A function returning a boolean to determine if the interaction is possibleOptional
Example
st.create3DTextUIOnPlayer("player1", {
{
id = "greet",
text = "Hello!",
displayDist = 10.0,
interactDist = 2.0,
key = "E",
keyNum = 38,
player = 1,
onSelect = function()
print("Player interacted with player!")
end,
canInteract = function()
return true
end,
},
})st.update3DTextUIOnPlayer()
Updates the 3D text UI attached to a player.
Syntax
st.update3DTextUIOnPlayer(id, optionId, data)Parameters
id : string
The id of the options category
optionId : string
The id of the option
data : object
id: integer - The unique id of the optionstext: string - The text which is shown when in interact distancedisplayDist: integer - The distance before the pin marker is showninteractDist: integer - The distance before the interaction is shownkey: string - The display key for the interactionkeyNum: integer - The actual key listener the script will listen to.player: integer - The player server idbone: string - The bone of the entityOptional
Example
st.update3DTextUIOnPlayer("player1", "greet", {
id = "greet",
text = "Hello!",
displayDist = 10.0,
interactDist = 2.0,
key = "E",
keyNum = 38,
player = 1,
})st.remove3DTextUIFromPlayer()
Removes the 3D text UI attached to a player.
Syntax
st.remove3DTextUIFromPlayer(id)Parameters
id : string
The id of the options category
Example
st.remove3DTextUIFromPlayer("player1")st.remove3DTextUIFromPlayerOption()
Removes an option on the 3D text UI attached to a player.
Syntax
st.remove3DTextUIFromPlayerOption(id, optionId)Parameters
id : string
The id of the options category
optionId : string
The id of the option
Example
st.remove3DTextUIFromPlayerOption("player1", "greet")Coords 3D Text UI
st.create3DTextUIOnCoords()
Creates a 3D text UI attached to a coord.
Syntax
st.create3DTextUIOnCoords(id, options)Parameters
id : string
The id of the options category
options : table
option: object
id: integer - The unique id of the optionstext: string - The text which is shown when in interact distancedisplayDist: integer - The distance before the pin marker is showninteractDist: integer - The distance before the interaction is shownkey: string - The display key for the interactionkeyNum: integer - The actual key listener the script will listen to.coords: vector3 - The coord where the interaction is locatedonSelect: function - The function triggered when the interaction is selectedcanInteract: function - A function returning a boolean to determine if the interaction is possibleOptional
Example
st.create3DTextUIOnCoords("coord1", {
{
id = "greet",
text = "Hello!",
displayDist = 10.0,
interactDist = 2.0,
key = "E",
keyNum = 38,
coords = vector3(0.0, 0.0, 0.0),
onSelect = function()
print("Player interacted with the location!")
end,
canInteract = function()
return true
end,
},
})st.update3DTextUIOnCoords()
Updates the 3D text UI attached to a coord.
Syntax
st.update3DTextUIOnCoords(id, optionId, data)Parameters
id : string
The id of the options category
optionId : string
The id of the option
data : object
id: integer - The unique id of the optionstext: string - The text which is shown when in interact distancedisplayDist: integer - The distance before the pin marker is showninteractDist: integer - The distance before the interaction is shownkey: string - The display key for the interactionkeyNum: integer - The actual key listener the script will listen to.coords: vector3 - The coord where the interaction is located
Example
st.update3DTextUIOnCoords("coord1", "greet", {
id = "greet",
text = "Hello!",
displayDist = 10.0,
interactDist = 2.0,
key = "E",
keyNum = 38,
coords = vector3(0.0, 0.0, 0.0),
})st.remove3DTextUIFromCoords()
Removes the 3D text UI attached to a coord.
Syntax
st.remove3DTextUIFromCoords(id)Parameters
id : string
The id of the options category
Example
st.remove3DTextUIFromCoords("coord1")st.remove3DTextUIFromCoordsOption()
Removes an option on the 3D text UI attached to a coord.
Syntax
st.remove3DTextUIFromCoordsOption(id, optionId)Parameters
id : string
The id of the options category
optionId : string
The id of the option
Example
st.remove3DTextUIFromCoordsOption("coord1", "greet")Entity 3D Text UI
st.create3DTextUIOnEntity()
Creates a 3D text UI attached to a entity.
Syntax
st.create3DTextUIOnEntity(id, options)Parameters
id : string
The id of the options category
options : table
option: object
id: integer - The unique id of the optionstext: string - The text which is shown when in interact distancedisplayDist: integer - The distance before the pin marker is showninteractDist: integer - The distance before the interaction is shownkey: string - The display key for the interactionkeyNum: integer - The actual key listener the script will listen to.entity: integer - The entity idnetId: integer - The network id Optionalbone: string - The bone of the entityOptionalonSelect: function - The function triggered when the interaction is selectedcanInteract: function - A function returning a boolean to determine if the interaction is possibleOptional
Example
st.create3DTextUIOnEntity("entity1", {
{
id = "greet",
text = "Hello!",
displayDist = 10.0,
interactDist = 2.0,
key = "E",
keyNum = 38,
entity = 252525,
onSelect = function()
print("Player interacted with entity!")
end,
canInteract = function()
return true
end,
},
})st.update3DTextUIOnEntity()
Updates the 3D text UI attached to a entity.
Syntax
st.update3DTextUIOnEntity(id, optionId, data)Parameters
id : string
The id of the options category
optionId : string
The id of the option
data : object
id: integer - The unique id of the optionstext: string - The text which is shown when in interact distancedisplayDist: integer - The distance before the pin marker is showninteractDist: integer - The distance before the interaction is shownkey: string - The display key for the interactionkeyNum: integer - The actual key listener the script will listen to.entity: integer - The entity idnetId: integer - The network id Optionalbone: string - The bone of the entityOptional
Example
st.update3DTextUIOnEntity("entity1", "greet", {
id = "greet",
text = "Hello!",
displayDist = 10.0,
interactDist = 2.0,
key = "E",
keyNum = 38,
entity = 252525,
})st.remove3DTextUIFromEntity()
Removes the 3D text UI attached to a entity.
Syntax
st.remove3DTextUIFromEntity(id)Parameters
id : string
The id of the options category
Example
st.remove3DTextUIFromEntity("entity1")st.remove3DTextUIFromEntityOption()
Removes an option on the 3D text UI attached to a entity.
Syntax
st.remove3DTextUIFromEntityOption(id, optionId)Parameters
id : string
The id of the options category
optionId : string
The id of the option
Example
st.remove3DTextUIFromEntityOption("entity1", "greet")Model 3D Text UI
st.create3DTextUIOnModel()
Creates a 3D text UI attached to a model.
Syntax
st.create3DTextUIOnModel(id, options)Parameters
id : string
The id of the options category
options : table
option: object
id: integer - The unique id of the optionstext: string - The text which is shown when in interact distancedisplayDist: integer - The distance before the pin marker is showninteractDist: integer - The distance before the interaction is shownkey: string - The display key for the interactionkeyNum: integer - The actual key listener the script will listen to.model: string - The model namebone: string - The bone of the entityOptionalonSelect: function - The function triggered when the interaction is selectedcanInteract: function - A function returning a boolean to determine if the interaction is possibleOptional
Example
st.create3DTextUIOnModel("model1", {
{
id = "greet",
text = "Hello!",
displayDist = 10.0,
interactDist = 2.0,
key = "E",
keyNum = 38,
model = "ch_prop_diamond_trolly_01b",
onSelect = function()
print("Player interacted with model!")
end,
canInteract = function()
return true
end,
},
})st.update3DTextUIOnModel()
Updates the 3D text UI attached to a model.
Syntax
st.update3DTextUIOnModel(id, optionId, data)Parameters
id : string
The id of the options category
optionId : string
The id of the option
data : object
id: integer - The unique id of the optionstext: string - The text which is shown when in interact distancedisplayDist: integer - The distance before the pin marker is showninteractDist: integer - The distance before the interaction is shownkey: string - The display key for the interactionkeyNum: integer - The actual key listener the script will listen to.model: string - The model namebone: string - The bone of the entityOptional
Example
st.update3DTextUIOnModel("model1", "greet", {
id = "greet",
text = "Hello!",
displayDist = 10.0,
interactDist = 2.0,
key = "E",
keyNum = 38,
model = "ch_prop_diamond_trolly_01b",
})st.remove3DTextUIFromModel()
Removes the 3D text UI attached to a model.
Syntax
st.remove3DTextUIFromModel(id)Parameters
id : string
The id of the options category
Example
st.remove3DTextUIFromModel("model1")st.remove3DTextUIFromModelOption()
Removes an option on the 3D text UI attached to a model.
Syntax
st.remove3DTextUIFromModelOption(id, optionId)Parameters
id : string
The id of the options category
optionId : string
The id of the option
Example
st.remove3DTextUIFromModelOption("model1", "greet")