Verse Library verse

02 Comparison

Handles purchasing logic by checking balance, deducting cost, adding inventory, and tracking totals.

extracted-snippets/documentation/en-us/fortnite/int-in-verse/02-comparison.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/int-in-verse
# Local doc:  epic-docs/documentation/en-us/fortnite/int-in-verse.md
# Section:    Comparison
# Check that the player can afford this purchase.
if (Coins >= CoinsPerQuiver):
# They can! Proceed with the purchase
set Coins -= CoinsPerQuiver
set Arrows += ArrowsPerQuiver
set TotalPurchases += 1

Comments

    Sign in to vote, comment, or suggest an edit. Sign in