📍Pos Helper
What it does
Register :
Example :
local STORAGE_POINT = {
coords = vec3(-40.0, -1095.0, 25.0),
message = "Open the locker",
icon = "Box",
intent = "inform",
holdKey = 38, -- E
holdTime = 0.5,
interactRange = 4.0,
holdDistance = 2.0,
heightOffset = 1.2
}
exports["Var-Interact"]:positionRegister(
STORAGE_POINT.coords,
nil,
{
message = STORAGE_POINT.message,
icon = STORAGE_POINT.icon,
intent = STORAGE_POINT.intent,
holdKey = STORAGE_POINT.holdKey,
holdTime = STORAGE_POINT.holdTime,
interactRange = STORAGE_POINT.interactRange,
holdDistance = STORAGE_POINT.holdDistance,
heightOffset = STORAGE_POINT.heightOffset,
canInteract = function(_, dist, spec)
if dist > 1.5 then
return false -- Too far to interact
end
end,
onInteract = function(i, _, spec)
print("Static point triggered", i, spec.pos)
TriggerEvent("mylife:lockers:open", spec.pos)
end
}
)Notes
Last updated