CoinsEngine
  • 🏠 General
    • 🔌 Getting Started
    • 🏃‍♂️ Migration
    • 📄 Commands
    • ⛔ Permissions
    • 🧩 Compatibility
    • ❓ Common Questions
    • ❗ Common Issues
  • ⭐ Features
    • 💵 Economy Setup
    • 🥏 Cross-Server Setup
    • 💶 Exchange Setup
  • 🧰 Utility
    • 🪛 Developer API
    • 🔖 Placeholders
Powered by GitBook
On this page
  1. ⭐ Features

💶 Exchange Setup

CoinsEngine allows your players to exchange one currency for another!

Setup:

Let's assume we have 2 currencies: Gems and Coins, where: 1 Gem = 5 Coins.

In /currencies/gems.yml config file go to Exchange -> Rates section and set it to:

Exchange:
  Allowed: true # Must be enabled.
  Rates:
    coins: 5.0

In the code above, coins is the name of a currency that Gems can be exchanged for, and the 5 is amount of exchanged currency per 1 gem.

Do the same for /currencies/coins.yml config file:

Exchange:
  Allowed: true # Must be enabled.
  Rates:
    gems: 0.2

0.2 is because it's exchange amount per 1 coin, so 5 coins will result in 1 gem.

Last updated 8 months ago