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.
local opened = exports['bupa-animpos']:Open()
if opened then
print('Positioning mode started')
endClose
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.
exports['bupa-animpos']:Close()IsActive
Returns a boolean indicating whether positioning mode is currently open for the local player.
if exports['bupa-animpos']:IsActive() then
-- e.g. block another interaction while the tool is open
endExample — pair with an emote menu
-- 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)Related — the CanUse config hook
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.CanUse = function()
-- return false, 'You cannot do this right now!'
return true
end