Custom Variables

Let your customers customize their purchases by providing extra customizable input like, names, or numbers. These values are passed into your product commands and can even affect pricing.

What Are Custom Variables?

Custom Variables allow you to collect additional input from customers at checkout. This can include:

  • Dropdown selections (e.g. server region, item color)

  • Text input (e.g. username, tag)

  • Numeric input (e.g. levels, amounts)

These values can be used dynamically in your product commands and templates, giving you much more flexibility without needing separate products.


Creating a Custom Variable

To get started:

  1. Navigate to the Custom Variables tab in your dashboard.

  2. Click the New custom variable button.

You’ll be prompted to enter the following:

  • Name: Displayed to customers.

  • Identifier: Used in commands as {identifier}.

  • Description (optional): Appears under the input on the product page.

  • Type: Choose between:

    • Dropdown – Add multiple options, each with optional extra cost.

    • Text – Freeform input. Supports regex validation.

    • Number – Numeric input. Also supports regex validation.


Example Usage in Command

Let’s say you’ve added the following custom variables:

  • {kit} (Dropdown – e.g. bronze, silver, gold)

  • {name} (Text – e.g. β€œLord”)

  • {slots} (Number – e.g. 6)

You can reference these in your command like so:

oxide.usergroup add {customer.steam.id} {kit}
say "{customer.name} just purchased the {kit} package!"
o.grant user {customer.steam.id} backpacks.size.{slots}

If the customer selects:

  • Kit: gold

  • Name: Lord

  • Slots: 6

Your executed commands will be:

oxide.usergroup add 7656119XXXXXXXXXXX gold
say "Lord just purchased the gold package!"
o.grant user 7656119XXXXXXXXXXX backpacks.size.6

This setup is ideal for selling VIP ranks, timed perks, or custom packages in Rust stores.


Pricing Options (Dropdown Only)

For dropdown variables, you can define:

  • Name/Value: Shown to the customer and used in commands.

  • Pricing Type: Fixed or Percentage.

  • Additional Cost: Charge extra for certain options if needed.


Notes

  • These variables are optional. If not filled, they will not be injected.

  • Regex validation helps ensure valid input for Text and Number types.

Last updated