#(Arkyoh) <player.has_money[xxx]>

22 messages · Page 1 of 1 (latest)

dense shuttle
#

What's the good syntax to use the "has:" key in an economy script?
There is no <player.has_money[xxx]> tag in the documentation

dire wagonBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

peak crane
#

There's an example

#

!lang economy

open islandBOT
# peak crane !lang economy

Economy script containers

Economy script containers provide a Vault economy, which can be used in scripts by
!tag PlayerTag.money and !command money
and as well by any other plugin that relies on economy functionality (such as shop plugins).

Note that vault economy bank systems are not currently supported.
Per-world economies are also not currently supported.

Note that in most cases, you do not want to have multiple economy providers, as only one will actually be in use.

ALL SCRIPT KEYS ARE REQUIRED.

Economy scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags).


# The script name will be shown to the economy provider as the name of the economy system.
Economy_Script_Name:

    type: economy

    # T

...

Required Plugins or Platforms

Vault

Group

Script Container System

peak crane
#

The economy script stores the money into a player flag

#

So you have to read it from the flag

dense shuttle
#

No, sorry, my question was not clear enough

#

I created my economy script successfully but what I don't know is how to use the "has" property"

#

for example the balance property is used with the <player.money> tag

#

I could basically just make a comparison:
- if <player.money> >= <[amount]>:
But I suppose that if there is a "has" key I could do something like:
- if <player.has_money[<[amount]>]>:

peak crane
#

It has to be a tag

#

You can't use commands

#

You specifically have to check the flag.

dense shuttle
#

I don't speak about the value of this key, but of its usage

#

Let's say I have a script where a player purchases something, I need to check if this player has enough money for this purchase

peak crane
#

Oh I see

dense shuttle
#

Nice! And then?

hallow atlas
#

Vault technically has that functionality, but don't think it's implemented as a tag, since there's basically no point usually

hallow atlas
#

Although I suppose it would be a valid low priority feature request if you want to, since it could be useful in specific cases