skWorth

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

TobyMinceraft

Member
Jul 21, 2019
18
2
3
25
skWorth by TobyMinceraft

NOTE
Almost everything you see here is described more in-depth on my "wiki" located on my website: https://tmcmedia.risingdawn.fun/projects/skript-buy-command

Description
A simple script which gives server owners a customizable "/buy" command for players. This allows you to sell ALL vanilla Minecraft items on your server, so long as you have previously set them in your Essentials (or custom) worth.yml file (does not support custom items)

Customization
Almost everything in this skript can be customized, up to a point. You may alter messages to your liking, but they are concealed in the code and may corrupt things if you're not careful! Some configurable options include:
  • Location of worth.yml file, if different than Essentials'
  • Internal name of cache (used by skript-yaml, in case another yaml-based script uses the same name)
  • Chat prefix for messages used by this script (not messages sent to console)
  • Player balance type (not to be confused with money type); this is as simple as player's balance or a Skript variable such as {balance::%player's uuid%}
  • And more! (all of these explained on the "wiki")
Required Plugins
Skript (duh)
https://github.com/SkriptLang/Skript/releases
- If you don't have Skript, you can't use this script!
skript-yaml
https://github.com/Sashie/skript-yaml/releases
- Used to read yml values from the worth.yml file
SkQuery
https://github.com/SkQuery/SkQuery/releases
- Used to locate your yml file and necessary plugins

Optional Plugins
Essentials / EssentialsX
https://www.spigotmc.org/resources/essentialsx.9089/
- If you want to set an item's worth value using an in-game command, you must install Essentials/EssentialsX; this plugin also comes with it's own economy!
Vault
https://dev.bukkit.org/projects/vault
- Required by Essentials/EssentialsX and most economy plugins
- Also required if you wish to use "player's balance" as the script's player balance manager

Tested Plugin / Server Versions
Skript = v2.4.1
- Minimum required version: unknown
skript-yaml = v1.3.2
- Minimum required version: v1.2.1
SkQuery = v3.6.5
- Minimum required version: v3.6.2
Spigot/Paper = git-Paper-162 (MC: 1.15.2)

IMPORTANT NOTICE
1) This skript does NOT (currently) allow you to set an item's worth using an in-game command. If you want that feature, use the Essentials/EssentialsX plugins. This script automatically detects the worth file generated by Essentials, so all you'd need to do is move your file to the Essentials folder.
2) Please note: if you can sell an item on your server, (using this script) you can buy it - it is (currently) not possible to make certain items in the worth file to not be purchasable. If I get enough people to suggest it, I may add it as a feature later.
3) DO NOT use the reviews section to post bugs or request features. Instead, post them in the "Discussions" tab so that way anyone with an answer may respond to your request should they see it before I do.
4) This script is NOT a standalone player balance management system. Create your own or find one, or use the Essentials plugin or any other Vault-compatible economy plugin.

How This Script Works
There's a few steps involved to getting this script to load properly, but here's the gist of what happens:
1) Script checks to see if you are using the player's balance or a custom skript variable
2) If using player's balance, script then checks to see if Vault is running (by locating the config); if not, goes to next step
3) Script checks to see if the default Essentials worth.yml file is found; if not, locates other file specified in the file location option
4) If all has passed, script finishes loading and the /buy command is ready for use; if not, script file disables itself

Tutorial / Wiki
This script doesn't have a tutorial per-say, but the config and options are described more in-depth on the wiki.

Final Note
Though this skript is made to work with 1.15 and 1.14, this should work with versions lower, just make sure of the following:
- The version of Skript you are using works with your server version
- The version of SkQuery you are using works with your server version
- The version of Essentials/EssentialsX you are using works with your server version
- The version of skript-yaml you are using works with your server version
- The version of Vault you are using works with your server version
[doublepost=1589387082,1588840428][/doublepost]I'll post this here as it seems to be the best way for you to see work-in-progress updates for a resource.

I'm currently working on a video tutorial for this, going up on my channel within a few days. This will show you how to install it using the default method, skript currency method, and SkQuery vs. skript-yaml method. Hopefully I can explain this in a way that makes better sense than just reading the text here and on my website.