Custom Items - On Click
Executable types:
To add a custom on-click event to your item, you will need to do the following:
Let's take the item from "Custom Items - Creating" for this example.
On Click - Free
Free
The "free"
event will execute anything in the "execute"
variable without any condition.
On Click - Buy
Buy
The "buy" event has a few rules. It requires a type of currency, either "MONEY" or "ITEM".
Buy currency types:
"MONEY"
- Using an economy plugin such as Vault to charge the player"ITEM"
- Instead of money, charge the player an item.If the
"model-data"
is -1, any kind of item of that type will be accepted as payment.If the
"model-data"
is <any number>, only items with that custom model data will be accepted as payment.And the
"amount"
is the amount of that item to charge the player.
Executable types:
After you're done with the buy type, its time for the executables.
You will need to add another "buy" value, and to it assign the following:
An "execute" variable, that runs on click.
An "on-success" variable, that will run if the transaction was a success.
And an "on-fail" variable, that will run if the player does not have sufficient funds.
On Click - Special
The special tag, as per its name, is a special tag that does things only BaseRaiders can do, such as buying fuel, upgrading or collecting the generator.
More info about special executables here:
Last updated