Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

addCoins

addCoins(authority, entity, amount): void

Adds amount coins to the entity’s wallet, giving it a wallet where it has none, and to the coins its world has credited, which readCreditedCoins reads and a round scores: a pickup, a kill’s bounty, a merchant’s payment. Coins are an outcome, so it takes an authority first, as dealDamage does: addCoins(step, character, 5). Zero changes nothing. An amount below 0, or no finite number, throws, and so does a credit that would leave the wallet, or the coins its world has credited, no finite number.

Parameter Type
authority Authority
entity Entity
amount number

void