Skip to main content

Introduction

The RSG Framework includes a built-in reputation system that allows you to track player progress, achievements, and standing across various activities. The system is completely flexible - you can create any reputation types you need for your server, from hunting skills to lawman standing. Version: 2.3.6+
Reputation is stored in player metadata and persists across sessions. Create unlimited custom reputation types!

Core Features

🎯 Flexible Reputation Types

  • Unlimited Types: Create any reputation categories you need
  • Server-Specific: Define reputations that fit your gameplay
  • Persistent Storage: Saved in player metadata (database)
  • Integer-Based: Whole numbers from 0 to unlimited

📊 Simple API

  • Add Reputation: Increase reputation points
  • Remove Reputation: Decrease reputation points (minimum 0)
  • Get Reputation: Check current reputation level
  • No Maximum: Reputation can grow indefinitely

🔄 Common Use Cases

  • Skill Tracking: hunting, fishing, crafting, mining
  • Faction Standing: lawman, outlaw, trader reputation
  • Activity Progress: deliveries, arrests, bounties
  • Social Standing: town reputations, gang loyalty
  • Achievement Systems: milestones and progression

How It Works

Reputation Storage

Reputation is stored in PlayerData.metadata.rep as a key-value table:

Reputation Structure

Data Flow


Player Reputation Functions

Add Reputation

Add reputation points to a specific type.
Parameters:
  • rep (string) - Reputation type name
  • amount (number) - Points to add
Example:
Reputation types are created automatically when first used. No need to pre-define them!

Remove Reputation

Remove reputation points from a specific type.
Parameters:
  • rep (string) - Reputation type name
  • amount (number) - Points to remove
Example:
Reputation cannot go below 0. If you try to remove more than available, it will be set to 0.
Behavior:

Get Reputation

Get the current reputation points for a specific type.
Parameters:
  • rep (string) - Reputation type name
Returns:
  • number - Current reputation points (returns 0 if type doesn’t exist)
Example:

Common Reputation Types

Skill-Based Reputations

Track player proficiency in various activities:

Faction/Standing Reputations

Track relationships with groups:

Implementation Examples

Example 1: Hunting Reputation System

Example 2: Lawman vs Outlaw System

Example 3: Reputation-Locked Content

Example 4: Reputation Decay Over Time

Example 5: Reputation Rewards and Perks

Example 6: Reputation Leaderboard

Example 7: Multi-Reputation Requirements


Reputation Tier Systems

Creating Reputation Tiers


Best Practices

Use descriptive reputation names: Choose clear, lowercase names like ‘hunting’, ‘lawman’, not abbreviations
Don’t use special characters: Stick to letters, numbers, and underscores for reputation type names
Provide feedback: Always notify players when they gain or lose reputation

Design Guidelines

  1. Meaningful Gains: Make reputation gains feel rewarding
    • Small tasks: 1-5 rep
    • Medium tasks: 5-15 rep
    • Large tasks: 15-50 rep
    • Milestones: 50+ rep
  2. Clear Thresholds: Set clear milestones for unlocks
    • Tier 1: 0-49 (Novice)
    • Tier 2: 50-99 (Apprentice)
    • Tier 3: 100-199 (Skilled)
    • Tier 4: 200-299 (Expert)
    • Tier 5: 300-499 (Master)
    • Tier 6: 500+ (Legendary)
  3. Balance Gains vs Losses:
    • Easier to gain than lose (2:1 ratio recommended)
    • Protect new players from excessive reputation loss
    • Consider reputation decay for inactive skills
  4. Multiple Paths: Allow different activities to earn same reputation
    • Hunting: killing animals, selling pelts, completing challenges
    • Lawman: arrests, patrols, investigations
    • Trading: sales, deliveries, negotiations

Troubleshooting

Possible causes:
  • Player data not saving to database
  • Metadata corruption
  • Server crash before save
Solution:
  • Check auto-save interval (default: 5 minutes)
  • Verify database connection
  • Manually trigger save: Player.Functions.Save()
Explanation: This is normal!
  • GetRep() returns 0 for non-existent reputation types
  • Reputation types are created on first AddRep() call
  • No need to initialize reputation types
Solution: Just use GetRep() - it handles missing types automatically
Explanation: This cannot happen!
  • RemoveRep() clamps at 0 minimum
  • Even removing more than available sets it to 0
  • Negative reputation is not supported
Workaround: Use separate reputation types for opposing factions (lawman vs outlaw)
Possible causes:
  • Database not saving metadata properly
  • Metadata JSON corruption
  • Auto-save not running
Solution:
  • Check players table metadata column
  • Verify JSON format is valid
  • Ensure RSGCore.Config.UpdateInterval is set

Technical Details

Database Storage

Reputation is stored in the metadata JSON column:

Implementation Location

Reputation functions are in rsg-core/server/player.lua:

Performance Considerations

  • Reputation operations are O(1) - very fast
  • Changes saved to database every 5 minutes (auto-save)
  • No network overhead (server-side only)
  • Minimal memory footprint (integer storage)

Next Steps


Need help? Join the RSG Framework Discord!