Available Exports
R_Store provides three server-side exports for managing player credits:Add Credits
Give credits to a player
Remove Credits
Take credits from a player
Get Balance
Check player’s credit balance
Add Credits to Player
Give credits to a player by their server ID.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
source | number | Player’s server ID |
amount | number | Amount of credits to add |
Example Usage
Remove Credits from Player
Remove credits from a player by their server ID.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
source | number | Player’s server ID |
amount | number | Amount of credits to remove |
Example Usage
Get Player Coin Balance
Retrieve a player’s current credit balance.Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
source | number | Player’s server ID |
Returns
| Type | Description |
|---|---|
number | Player’s current credit balance |
Example Usage
Integration with R_Casino
If using both R_Store and R_Casino, you can share the credit system:In R_Casino config.lua
Integration with R_FFA
R_FFA can use R_Store credits for wager matches:In R_FFA config.lua
Best Practices
Always Check Balance First
Always Check Balance First
Before removing credits, always check if the player has enough:
Validate Input
Validate Input
Always validate amounts to prevent negative values or exploits:
Handle Errors
Handle Errors
Implement proper error handling:
Troubleshooting
Common Export Issues
Having problems with exports? Check our troubleshooting guide
