Skip to content

Exports

Exports

BUPA AnimPos exposes three client exports so other resources can drive the tool programmatically. All run under the resource name bupa-animpos.

Open

Opens the tool. This runs the full check pipeline — already-in-use, cooldown, permission, state restrictions and the Config.CanUse hook — exactly as if the player used the command or keybind. Returns true if the tool actually opened, false otherwise.

client
local opened = exports['bupa-animpos']:Open()
if opened then
    print('Positioning mode started')
end

Close

Requests the tool to close if it is currently active. This behaves like pressing cancel — the character is returned to its starting position and heading.

client
exports['bupa-animpos']:Close()

IsActive

Returns a boolean indicating whether positioning mode is currently open for the local player.

client
if exports['bupa-animpos']:IsActive() then
    -- e.g. block another interaction while the tool is open
end

Example — pair with an emote menu

client
-- After playing an emote, let the player nudge it into place
RegisterCommand('fixpos', function()
    if not exports['bupa-animpos']:IsActive() then
        exports['bupa-animpos']:Open()
    end
end)

Beyond the exports, Config.CanUse is a client-side hook that runs on every open attempt (including via Open()). Return false to block and optionally a message string to show the player. This is the intended place for server-specific gating logic (combat, damage, custom states).

config.lua
Config.CanUse = function()
    -- return false, 'You cannot do this right now!'
    return true
end