BuyRandom
Use Buycraft, but would like a way to give users random rewards for their donations? Then you will probably like this plugin!
Features
- Execute a random command from a list when someone donates for a specific package.
- Allows using the player's name in the commands.
- Allows up to one extra argument
Installation
Download the plugin from this page, and put it in your plugins-folder. Then re-start your server. The plugin will generate a config in a folder named 'BuyRandom'. The config will be further explained in the usage-section.
Usage
Step 1: Config
The first thing you want to do, is set up the config. This is the example-config the plugin will generate:
package1: - tell {name} {arg} - say {name} has just bought the package {arg}! package2: - give {name} 1 2 - give {name} 5 2
'package1' and 'package2' are package-names. It doesn't really matter what they're called, but you will need them later, to use this plugin with Buycraft. Under the package-name is a list of all the possible commands. When that package is rewarded, a random command from the list will be executed. In the commands, {name} will be replaced with the player-name, and {arg} with an argument you can later specify (for example an amount).
Step 2: Buycraft
After you've set up your config, it's time to set things up on the Buycraft-side. Log in to your Buycraft-account, and create a new package. Adjust all the settings to you liking, and add the following command to the commands-field (initial): 'buyrandom <package-name> {name} [arg]'. Replace <package-name> with the name of your package in the config (package1 or package2 in the example). You can leave {name} as it is. Buycraft will replace it with the player-name. If you want to, you can replace [arg] with an additional argument. If you do, {arg} in the commands in your config will be replaced with the argument you specify. After that, just save your package and you're good to go! If you want, you can test your package by using the Buycraft 'add payment'-button, or by using the buyrandom command in-game.
Permissions/commands
- /buyrandom <package-name> <player-name> [arg] - Award a package to <player-name>. Permission: buyrandom.execute
Hi there! Is it possible to send a message to the player to tell them what prize they received? Or could you please post the source code?
Thank you, ~ Liz
This plugin is very important in my server.
I just hope you do not forget, actually works, but needs some additions as: reload command.
Greetings and thanks
Many months later...
Was any progress made?
@jorisk322
I don't know how busy the next three weeks will be, but after that, I should have lots of time.
@jorisk322
Any idea when that will be? A few weeks, months...?
@Corsicaman
Good idea. Will probably do that when I have time.
Could you make it so that in each pack, instead of one command, a group a commands is chosen randomly?
For example, I'd like to create 1 "money" pack:
money:
- first possibility
- broadcast {name} just bought a pack and got &61000$
- eco give {name} 1000
- second possibility
- broadcast {name} just bought a pack and got &65000$
- eco give {name} 5000
That'd be great!