DirkScripts
Docs
Interact
âšī¸ Client Module - This can only be used on the client
#lib.interact.register
Create a new player interaction
lualib.interact.register(name, data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | String | true | Unique reference for the interaction |
| data | Object | true | Options for the interact, refer to Data Structure |
#lib.interact.get
Get information regarding an interaction
local interaction = lib.interact.get(name)
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | String | true | Unique reference for the interaction |
#lib.interact.destroy
Completely remove an interaction by name
lualib.interact.destroy(name)
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | yes | Unique reference for the interaction |
#lib.interact.entity
Add an interaction to a specific entity
lualib.interact.entity(entity, data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| entity | number | yes | Entity handle |
| data | table | yes | Interaction options |
#lib.interact.addModels
Add interactions to one or more models globally
lualib.interact.addModels(data)
#lib.interact.addGlobalVehicle
Add interactions to all vehicles
lualib.interact.addGlobalVehicle(data)
#lib.interact.addCoords
Add an interaction at specific world coordinates
lualib.interact.addCoords(data)
#lib.interact.addGlobalPlayer
Add interactions to all players
lualib.interact.addGlobalPlayer(data)
#lib.interact.addGlobalPed
Add interactions to all peds
lualib.interact.addGlobalPed(data)
#lib.interact.removeById
Remove an interaction by its ID
lualib.interact.removeById(id)
#lib.interact.removeEntity
Remove all interactions from an entity
lualib.interact.removeEntity(entity)
#lib.interact.removeGlobalModel
Remove global model interactions
lualib.interact.removeGlobalModel(model)
#lib.interact.removeGlobalPlayer
Remove global player interactions
lualib.interact.removeGlobalPlayer(id)
#Data Structure
This is the data structure of an interaction and the valid options
There are multiple different interactions seen below:
#Circle
lua{ zone_type = "circle", pos = vector4(10, 10, 20, 10), radius = 10 }
#Poly
lua{ zone_type = "poly", polygon = { vector3(0, 0, 0), vector3(0, 0, 0), vector3(0, 0, 0), }, }
#Box
lua{ zone_type = "box", pos = vector4(10, 10, 20, 10), size = vector3(1, 1, 1) }
#Marker
lua{ zone_type = "marker", pos = vector4(10, 10, 20, 10), color = vector4(255, 255, 255, 255), -- RGBA scale = vector3(1, 1, 1), -- Not Required dir = vector3(0, 0, 0), rot = vector3(0, 0, 0), bob = false, face = false, txd = false, txn = false, drawEnts = false }
#Text
â ī¸ This documentation is pending confirmation
lua{ zone_type = "text", text = "Hello World" pos = vector4(10, 10, 20, 10), size = vector3(1, 1, 1) }
