Points

MSK.Points.Add

Adds a new Point.

Parameters data - table - Point data

Returns point - table - The added point

local point = MSK.Points.Add({
    coords = vector3(576.13, 2723.86, 42.06),
    distance = 5.0,
    onEnter = function(point)
        print('onEnter', point.id, point.coords, point.distance)
    end,
    onExit = function(point)
        print('onExit', point.id, point.coords, point.distance)
    end
})

print(point.id, point.coords, point.distance)

-- Remove the Point:
point.Remove()

MSK.Points.GetAllPoints

Get all Points.

Returns points - table - All Points

local points = MSK.Points.GetAllPoints()

for k, point in pairs(points) do
    print(point.id, point.coords, point.distance, point.inside)
end

MSK.Points.GetClosestPoint

Get the Point the Player is at.

Returns point - table? - The Point the Player is at or nil if the Player is not inside of any point

local point = MSK.Points.GetClosestPoint()

if point then
    print(point.id, point.coords, point.distance)
else
    -- Player is not inside of any point
end

Last updated