Animations Core
Prompt Anim Core
Installation Instructions
Step 2 โ Configure permissions
Edit your server.cfg to assign ACE permissions:
# Give admin group all gym permissions
add_ace group.admin gym.admin allow
# Add player to admin group
add_principal identifier.steam:YOUR_STEAM_ID group.adminTo disable all permissions and allow everyone to use admin tools:
Config.Permissions.usePermissions = falseConfiguration
๐ Permissions System
Config.Permissions = {
usePermissions = true, -- Set false to disable ACE checks
placeEquipment = "gym.place", -- Permission for /placeequipment
deleteEquipment = "gym.delete",
admin = "gym.admin" -- Grants all permissions
}/placeequipment
gym.place or gym.admin
โ Yes
Remove Equipment
gym.delete or gym.admin
โ Yes
To disable all permissions, set
Config.Permissions.usePermissions = false
๐๏ธ Equipment Definitions
Each equipment type includes:
model โ 3D prop name
label โ Display name in menu
animations โ Animation dictionary & clip
interactionZone โ Area size for usage
Available Equipment:
vin_chu โ Wooden dummy
leg_press โ Leg press machine
speedbag โ Punching bag
gymbike โ Exercise bike
gymlatpull โ Lat pull machine
gympullmachine1 โ Cable machine 1
gympullmachine2 โ Cable machine 2
gymrowpull โ Row machine
gymspeedbag โ Speed bag โ
Safe to edit: label, interaction radius
๐ซ Do not edit: model names, animation dicts/names
Admin Commands
/placeequipment
/placeequipmentPlace gym equipment anywhere with an in-game editor.
Controls:
WASD โ Move horizontally
PgUp/PgDn โ Adjust height
Q/E โ Rotate
G โ Snap to ground
ENTER โ Save placement
BACKSPACE โ Cancel
Requires
gym.placeorgym.adminpermission (unless disabled)
How it works:
Opens selection menu
Displays transparent preview
Move/rotate freely
Press ENTER to save โ instantly syncs for all players
Developer API
exports['prompt_anim_core']:SpawnGymEquipment(
equipmentType, -- "speedbag", "leg_press", etc.
coords, -- vector3(x, y, z)
heading, -- 0.0โ360.0
locationName, -- optional (e.g. "custom_gym")
instanceName -- optional unique ID
)Example:
exports['prompt_anim_core']:SpawnGymEquipment(
"speedbag",
vector3(100.0, 200.0, 30.0),
90.0,
"custom_location",
"my_speedbag_1"
)exports['prompt_anim_core']:DespawnGymEquipment("my_speedbag_1")Removes a specific piece of equipment by its instance name.
Get Equipment Types
local types = exports['prompt_anim_core']:GetEquipmentTypes()
-- returns: {"speedbag", "leg_press", ...}Check if Equipment Busy
local isBusy = exports['prompt_anim_core']:IsEquipmentBusy("my_speedbag_1")Get All Spawned Equipment
local equipment = exports['prompt_anim_core']:GetSpawnedEquipment()
-- returns table of all active props Exercise Tracking API
Hook into these events for progression or stats systems.
gym:exerciseStarted
gym:exerciseStartedAddEventHandler('gym:exerciseStarted', function(data)
print(data.playerName .. " started using " .. data.machineType)
end)gym:exerciseCompleted
gym:exerciseCompletedAddEventHandler('gym:exerciseCompleted', function(data)
print(data.playerName .. " completed " .. data.machineType)
print("Duration: " .. data.duration .. " seconds")
end)Data Example:
{
playerId = 1,
playerName = "John Doe",
machineName = "vinewood_default_speedbag_1",
machineType = "speedbag",
animationDict = "prompt@speedbag",
animationName = "speedbag@skel_clip_0",
position = vector3(x, y, z),
heading = 90.0,
location = "vinewood",
timestamp = 1699123456,
duration = 15
}User-Placed Props System (not sure yet)
Props placed via /placeequipment are stored in GlobalState, visible to all players.
โ Session-based
Props persist during active session
โ No DB save
Lost on server restart
๐งฉ Future update will include optional database persistence.
Lifecycle:
Admin places โ Saved in
GlobalState.gym_user_placed_propsNew player joins โ Client loads & spawns all
Admin removes โ Instantly removed from world
Interaction Systems
Two supported systems, auto-detected at runtime:
ox_target
Preferred. Circular interaction zones with โUse Equipmentโ prompts.
lib.zones
Fallback. TextUI prompts when nearby (press E).
If ox_target is not installed, the script automatically switches to lib.zones.
Debug Mode
Config.Debug = trueDisplays:
Spawn/despawn logs
Animation triggers
Player position/heading
Permission checks
Exercise data
Disable in production for best performance.
Dependencies
Required:
ox_lib
Optional:
ox_target(recommended for enhanced targeting)
Quick Start
Install and ensure
ox_lib(and optionallyox_target)Add
ensure prompt_anim_coretoserver.cfgConfigure permissions (or disable them)
Use
/placeequipmentto start placing gym propsPlayers interact via target zones or proximity prompts
Example: Custom Gym Resource
RegisterCommand('spawngym', function()
exports['prompt_anim_core']:SpawnGymEquipment("speedbag", vector3(100,200,30), 0.0, "custom", "bag1")
exports['prompt_anim_core']:SpawnGymEquipment("leg_press", vector3(105,200,30), 90.0, "custom", "press1")
exports['prompt_anim_core']:SpawnGymEquipment("gymbike", vector3(110,200,30), 180.0, "custom", "bike1")
end)
AddEventHandler('gym:exerciseCompleted', function(data)
print(data.playerName .. " earned XP for " .. data.machineType)
end)Troubleshooting & Support
Props not visible
Ensure ox_lib is running and resource is started
Can't use /placeequipment
Check ACE permissions or disable them in config
Animations not syncing
Increase SyncRadius or ensure players are within range
Props floating/clipping
Use G to snap to ground, adjust with PgUp/PgDn
Last updated
