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 inPlayerData.metadata.rep as a key-value table:
Reputation Structure
Data Flow
Player Reputation Functions
Add Reputation
Add reputation points to a specific type.rep(string) - Reputation type nameamount(number) - Points to add
Reputation types are created automatically when first used. No need to pre-define them!
Remove Reputation
Remove reputation points from a specific type.rep(string) - Reputation type nameamount(number) - Points to remove
Get Reputation
Get the current reputation points for a specific type.rep(string) - Reputation type name
number- Current reputation points (returns 0 if type doesn’t exist)
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
Provide feedback: Always notify players when they gain or lose reputation
Design Guidelines
-
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
-
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)
-
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
-
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
Reputation not saving
Reputation not saving
Possible causes:
- Player data not saving to database
- Metadata corruption
- Server crash before save
- Check auto-save interval (default: 5 minutes)
- Verify database connection
- Manually trigger save:
Player.Functions.Save()
Reputation showing as nil
Reputation showing as nil
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
GetRep() - it handles missing types automaticallyReputation going negative
Reputation going negative
Explanation: This cannot happen!
RemoveRep()clamps at 0 minimum- Even removing more than available sets it to 0
- Negative reputation is not supported
Reputation not persisting after restart
Reputation not persisting after restart
Possible causes:
- Database not saving metadata properly
- Metadata JSON corruption
- Auto-save not running
- Check
playerstablemetadatacolumn - Verify JSON format is valid
- Ensure RSGCore.Config.UpdateInterval is set
Technical Details
Database Storage
Reputation is stored in themetadata JSON column:
Implementation Location
Reputation functions are inrsg-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
- Player Data Reference - Complete player data structure
- StateBags System - Real-time data synchronization
- Server Functions - All server functions
Need help? Join the RSG Framework Discord!