> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r-scripts.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Exports

> Use R_Store exports to integrate with other resources

## Available Exports

R\_Store provides three server-side exports for managing player credits:

<CardGroup cols={3}>
  <Card title="Add Credits" icon="plus">
    Give credits to a player
  </Card>

  <Card title="Remove Credits" icon="minus">
    Take credits from a player
  </Card>

  <Card title="Get Balance" icon="wallet">
    Check player's credit balance
  </Card>
</CardGroup>

## Add Credits to Player

Give credits to a player by their server ID.

### Syntax

```lua theme={null}
exports['r_store']:addCoinsToPlayer(source, amount)
```

### Parameters

| Parameter | Type   | Description              |
| --------- | ------ | ------------------------ |
| `source`  | number | Player's server ID       |
| `amount`  | number | Amount of credits to add |

### Example Usage

```lua theme={null}
-- Give 100 credits to player ID 1
exports['r_store']:addCoinsToPlayer(1, 100)
```

## Remove Credits from Player

Remove credits from a player by their server ID.

### Syntax

```lua theme={null}
exports['r_store']:removeCoinsFromPlayer(source, amount)
```

### Parameters

| Parameter | Type   | Description                 |
| --------- | ------ | --------------------------- |
| `source`  | number | Player's server ID          |
| `amount`  | number | Amount of credits to remove |

### Example Usage

```lua theme={null}
-- Remove 50 credits from player ID 1
exports['r_store']:removeCoinsFromPlayer(1, 50)
```

## Get Player Coin Balance

Retrieve a player's current credit balance.

### Syntax

```lua theme={null}
exports['r_store']:getPlayerCoinBalance(source)
```

### Parameters

| Parameter | Type   | Description        |
| --------- | ------ | ------------------ |
| `source`  | number | Player's server ID |

### Returns

| Type     | Description                     |
| -------- | ------------------------------- |
| `number` | Player's current credit balance |

### Example Usage

```lua theme={null}
-- Check balance of player ID 1
local balance = exports['r_store']:getPlayerCoinBalance(1)
print("Player 1 has " .. balance .. " credits")
```

## Integration with R\_Casino

If using both R\_Store and R\_Casino, you can share the credit system:

### In R\_Casino config.lua

```lua theme={null}
R.UseRStoreCoins = true
R.RStoreResourceName = "r_store"
```

This allows players to use their R\_Store credits in the casino!

## Integration with R\_FFA

R\_FFA can use R\_Store credits for wager matches:

### In R\_FFA config.lua

```lua theme={null}
R.UseRStoreCredits = true
R.RStoreResourceName = "r_store"
```

## Troubleshooting

<Card title="Common Export Issues" icon="wrench" href="/r_store/common-issues">
  Having problems with exports? Check our troubleshooting guide
</Card>
