Represents the money system.

Constructors

  • Creates a new MoneySystem object.

    Parameters

    • playerID: `${number}`

      The ID of the player.

    Returns MoneySystem

Properties

playerID: `${number}`

Returns the player ID.

Accessors

  • get money(): bigint

    Returns the amount of money a player has.

    Returns bigint

Methods

  • Adds money to a player.

    Parameters

    • amount: number | bigint

      The amount of money to add to the player, should be a number or a bigint, can be negative.

    Returns boolean

    Returns true if the operation was successful. (Only returns false if config.moneySystem.useScoreboardBasedMoneySystem is true and the player's scoreboard identity is unable to be obtained)

  • Removes money from a player.

    Parameters

    • amount: number | bigint

      The amount of money to remove from the player, should be a number or a bigint, can be negative.

    Returns boolean

    Returns true if the operation was successful. (Only returns false if config.moneySystem.useScoreboardBasedMoneySystem is true and the player's scoreboard identity is unable to be obtained)

  • Sets the amount of money a player has.

    Parameters

    • amount: number | bigint = 0

      The amount of money to set the player to, should be a number or a bigint, can be negative.

    Returns boolean

    Returns true if the operation was successful. (Only returns false if config.moneySystem.useScoreboardBasedMoneySystem is true and the player's scoreboard identity is unable to be obtained)

  • Transfers a players money from a scorboard to the current money system.

    Parameters

    Returns boolean

    Returns true if the operation was successful.

  • Gets a MoneySystem object for a given player.

    Parameters

    • player: string | number | bigint | Entity | { id: string }

      The player to get the MoneySystem object for.

    Returns MoneySystem

    The MoneySystem object for the given player.

  • Transfers money from a scoreboard to the current money system, runs for all saved players with a saved scoreboard identity.

    Parameters

    Returns void