Interact

Used to register and control any player interaction

Client Module - This can only be used on the client

lib.interact.register

Create a new player interaction

lib.interact.register(name, data)
Parameter
Type
Required
Description

name

String

Unique reference for the interaction

data

Object

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

Unique reference for the interaction

lib.interact.destroy

Completely remove an interaction

lib.interact.destroy(name)
Parameter
Type
Required
Description

name

String

Unique reference for the interaction

Data Structure

This is the data structure of an interaction and the valid options

There are multiple different interactions seen below:

Circle

{
    zone_type = "circle",
    pos = vector4(10, 10, 20, 10),
    radius = 10
}

Poly

{
    zone_type = "poly",
    polygon = {
        vector3(0, 0, 0),
        vector3(0, 0, 0),
        vector3(0, 0, 0),
    },
}

Box

{
    zone_type = "box",
    pos = vector4(10, 10, 20, 10),
    size = vector3(1, 1, 1)
}

Marker

{
    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

{
    zone_type = "text",
    text = "Hello World"
    pos = vector4(10, 10, 20, 10),
    size = vector3(1, 1, 1)
}

Last updated