Introduction
RSG Framework includes a built-in prompt system that creates native Red Dead Redemption 2 style interaction prompts. These prompts appear when players approach specific locations and can trigger events when the correct key is pressed. Location:resources/[framework]/rsg-core/client/prompts.lua
Prompts are the primary way players interact with the world in Red Dead Redemption 2. Using native prompts ensures a consistent and immersive experience.
Core Features
๐ฏ Native RDR2 Style
- Authentic Look: Uses native RDR2 prompt system
- Consistent UX: Same style as game prompts
- Visual Feedback: Press-and-hold indicators
๐ Location-based
- Distance Checking: Only shows when player is nearby
- Coordinates: Precise 3D positioning
- Automatic Hide: Disappears when player leaves area
โก Event Integration
- Client Events: Trigger client-side events
- Server Events: Trigger server-side events
- Arguments: Pass custom data to events
Creating Prompts
Basic Syntax
Parameters
Options Table
Basic Examples
Example 1: Simple Client Prompt
Example 2: Server Event Prompt
Example 3: Multiple Prompts
Deleting Prompts
Basic Syntax
Example: Managing Prompt Lifecycle
Advanced Usage
Dynamic Prompts Based on Job
Conditional Prompts
Prompt with Hold Duration
For prompts that require holding the key, you can handle this in your event:Keybinds Reference
RSG Framework includes predefined keybinds inRSGCore.Shared.Keybinds:
Usage
Best Practices
Use Config for Coordinates: Store prompt locations in config files for easy adjustment
Performance Tips
- Batch Creation: Create multiple prompts in a single loop, not in separate threads
- Clean on Unload: Delete all prompts in
onResourceStop - Minimal Distance: Use appropriate interaction distances
- Avoid Duplicates: Check if prompt exists before creating
Common Patterns
Pattern 1: Shop System
Pattern 2: Door System
Troubleshooting
Prompt Not Appearing
Check coordinates
Check coordinates
Make sure the coordinates are correct and the player can actually reach that location:
Check unique ID
Check unique ID
Each prompt must have a unique location ID. If you use the same ID twice, the second one wonโt create.
Check keybind
Check keybind
Make sure youโre using a valid keybind from
RSGCore.Shared.Keybinds:Event Not Triggering
- Verify the event is properly registered
- Check if itโs โclientโ or โserverโ type
- Ensure event name matches exactly (case-sensitive)
Next Steps
- Callbacks - Learn about client-server communication
- Configuration - Configure prompt distance
- Shared Configuration - Access keybinds and shared data
- Player Data - Check player job/gang for conditional prompts
Need help? Join the RSG Framework Discord!