CodeRanch - Animation Menu

Advanced Animation System for RedM

This script provides a comprehensive and modern animation system for RedM servers. Players can perform hundreds of animations, scenarios, emotes, dances, and walks with an intuitive UI. The system includes quick animation slots, duo animations, animation positioning, and prop attachments.

🚀 Features

  • 500+ Animations: Scenarios, emotes, dances, walks, and gestures

  • Quick Animation Slots: Assign up to 4 animations to hotkeys (Shift+1-4)

  • Duo Animations: Synchronized animations with other players

  • Animation Positioning: Fine-tune animation position and rotation

  • Prop System: Attach props like umbrella, coffee, lantern, guitar, etc.

  • Bench/Chair System: Automatic sit detection on benches and chairs

  • Multi-Language Support: Easy language customization

  • Config-Based: Everything is configurable without touching the code

  • Database Integration: Saves quick animations per player

📋 Requirements

  • RedM Server (Latest recommended)

  • oxmysql (For database connection)

🛠️ Installation

1

Download Files

Copy the resource to your server's resources folder:

2

Database Setup

The script will automatically create the table on first start:

3

Server.cfg Settings

Ensure dependencies and the resource are started:

4

Configuration

Edit the config and language files to suit your server:

  • shared/config/config.lua

  • shared/config/language.lua

⚙️ Configuration

Quick Animation System

Duo Animation System

Bench/Chair Sit System

Clear Ped Command

Animation Position System

Prop Commands

Categories

Notification System

🎮 Usage

For Players

Opening Animation Menu

  • Command: /animmenu or press L key

  • Browse through categories

  • Search animations by name or command

  • Click on animation to play

Quick Animations

1

Open animation menu

2

Right-click on any animation to select it

3

Click on a quick slot (bottom of menu) to assign

4

Use Shift + 1-4 to play assigned animations

5

Right-click on quick slot to remove animation

Playing Animations

  • Via Menu: Click on animation in menu

  • Via Command: /e [animation_command]

    • Example: /e sit, /e dance, /e smoke

  • Clear Animation: /e c or /e clear

Duo Animations

1

Stand near another player

2

Use: /duoanim [animation_name] [player_id]

3

Other player accepts: /acceptanim

4

Other player rejects: /rejectanim

Animation Positioning

1

Start any animation

2

Use command: /animpos

3

Use controls to adjust:

  • Arrow Keys: Move forward/back/left/right

  • Scroll Wheel: Move forward/backward

  • Arrow Up/Down: Adjust height

  • Q/E: Rotate left/right

  • Enter: Confirm position

  • X: Cancel

Sitting on Benches

  • Use command: /sit near a bench or chair

  • Automatically detects available seats

  • Use /sit again to stand up

Prop Commands

  • /umbrella - Attach umbrella

  • /coffee - Attach coffee mug

  • /lantern - Attach lantern

  • /newspaper - Read newspaper

  • /sack - Carry sack

  • /flowers - Hold flowers

  • /beer - Hold beer bottle

  • /guitar - Hold guitar

  • /map - Read map

Clear All

  • /clearped - Removes all animations and attached props

🔧 Advanced Settings

Adding New Animation

Open shared/config/animations.lua and add to Config.Animations:

Scenario Animation

Regular Animation

Walk Style

Duo Animation

Adding New Category

1

Add the category to the config (shared/config/config.lua):

2

Add an optional category icon:

  • Place icon image in web/src/assets/mycategory-icon.png

3

Add language entry (shared/config/language.lua):

Adding New Prop Command

Add to Config.PropCommands in shared/config/config.lua:

Common bone names:

  • PH_R_Hand - Right hand

  • PH_L_Hand - Left hand

  • SKEL_Head - Head

  • SKEL_Spine3 - Upper back

  • SKEL_L_Foot - Left foot

  • SKEL_R_Foot - Right foot

Customizing Language

Edit shared/config/language.lua:

Customizing Animation Position Controls

Edit Config.AnimPos.keys in shared/config/config.lua:

Changing Quick Animation Hotkeys

Edit Config.QuickAnimations.secondPrefixs:

📊 Database Structure

Building UI Changes

🐛 Troubleshooting

1

Menu Not Opening

  • Check if key bind conflicts with other scripts

  • Try using command /animmenu instead

  • Check F8 console for errors

2

Animations Not Playing

  • Ensure animation dictionary/scenario exists in game

  • Check animation command spelling

  • Some animations require specific conditions

3

Quick Animations Not Saving

  • Check database connection

  • Ensure oxmysql is running

4

Props Not Attaching

  • Check prop model hash is correct

  • Verify bone name exists

  • Adjust offset/rotation values

5

Duo Animations Not Working

  • Both players must be within max distance

  • Ensure other player accepts request

6

Animation Position Not Working

  • Start an animation first before using /animpos

  • Check key binds don't conflict

  • Ensure Config.AnimPos.enabled = true

📝 Commands Reference

Player Commands

Command
Description

/animmenu or L

Open animation menu

/e [anim]

Play animation by command

/e c or /e clear

Clear current animation

/sit

Sit on nearest bench/chair

/clearped

Clear all animations and props

/animpos

Enter animation positioning mode

/duoanim [anim] [id]

Request duo animation

/acceptanim

Accept duo animation request

/rejectanim

Reject duo animation request

Prop Commands

Command
Description

/umbrella

Attach umbrella prop

/coffee

Attach coffee mug

/lantern

Attach lantern

/newspaper

Attach newspaper

/sack

Attach sack

/flowers

Attach flowers

/beer

Attach beer bottle

/guitar

Attach guitar

/map

Attach map

🔄 Updates

v1.0.0

  • Initial release

  • 500+ animations

  • Modern UI with categories

  • Quick animation system

  • Duo animations

  • Animation positioning

  • Prop system

  • Bench/chair detection

  • Multi-language support

  • Database integration

💡 Tips & Best Practices

  1. Performance: The menu loads animations in chunks (100 at a time) for better performance

  2. Quick Slots: Assign your most-used animations to quick slots for fast access

  3. Animation Positioning: Use this feature for precise RP scenarios (sitting at tables, etc.)

  4. Duo Animations: Great for RP scenarios like dancing, fighting choreography, etc.

  5. Props: Combine props with animations for enhanced roleplay

  6. Categories: Organize custom animations into appropriate categories

  7. Commands: Use short, memorable commands for frequently used animations

📄 License

This script is developed by CodeRanch. Commercial use requires permission.

Last updated