1. 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!


    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script currency

Discussion in 'Skript' started by Vkzo, Jan 23, 2020.

Thread Status:
Not open for further replies.
  1. Vkzo

    Vkzo Member

    Jan 22, 2020
    Likes Received:
    My vision is to have a custom made currency in game that players can earn to buy things with it like commands and ranks. I have finished the process of creating the currency. Players are able to pay each other with it. ops, and console are able to run the commands to add/remove the said currency to players balance. My only problem is when players attempt to buy something with the currency in the GUI I have created. They can purchase it as much as they want without any cost of the currency. I want the command/rank that they purchase from the GUI to be able to check if they have the correct amount of currency. Otherwise players are able to use it as if its free.

    Example: I have a GUI set up so it acts as a shop for this currency. I want all items in this GUI to have a cost of the currency I have made(This isn't the issue). (This is the issue)But If a player goes to buy an item in this GUI. It requires none of this currency, because of the fact that there is no way to check to players balance of the currency to see if they have enough to make the purchase. With that being said players can purchase anything in this GUI without any of this currency.

    I will post the script down below if anyone has any answers or codes I can use to make this possible. Please help me out it would be much appreciated!

    Attached Files:

  2. Goose


    Nov 23, 2019
    Likes Received:
    You can check if the player has enough bits to make a purchase with this line of code:

    Code (Text):
    1. if {balance::%player%} >=  500
    2. # change the "500" with whatever amount you want it to cost
    3. # the >= checks if the player's balance is equal to or greater than the specified amount
    By the way, I suggest you use %player's uuid% instead of %player%, because otherwise your player would lose all their bits upon changing their name.
Thread Status:
Not open for further replies.

Share This Page