Skip to main content

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 in RSGCore.Shared.Keybinds:

Usage


Best Practices

Use Unique Location IDs: Each prompt needs a unique location identifier to prevent conflicts
Always Clean Up Prompts: Delete prompts when theyโ€™re no longer needed to prevent memory leaks and ghost prompts
Use Config for Coordinates: Store prompt locations in config files for easy adjustment

Performance Tips

  1. Batch Creation: Create multiple prompts in a single loop, not in separate threads
  2. Clean on Unload: Delete all prompts in onResourceStop
  3. Minimal Distance: Use appropriate interaction distances
  4. Avoid Duplicates: Check if prompt exists before creating

Common Patterns

Pattern 1: Shop System

Pattern 2: Door System


Troubleshooting

Prompt Not Appearing

Make sure the coordinates are correct and the player can actually reach that location:
Each prompt must have a unique location ID. If you use the same ID twice, the second one wonโ€™t create.
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


Need help? Join the RSG Framework Discord!