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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    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.

Custom economy and factions

Discussion in 'Skript' started by KorixCZ, Jul 21, 2021 at 7:37 PM.

  1. KorixCZ

    KorixCZ Member

    Joined:
    Jun 29, 2021
    Messages:
    4
    Likes Received:
    0
    Hello, I have a problem .. I want to make a faction of the vineyard with a menu that will have a withdrawal and deposit money .. I want to do it so that as soon as I click on a certain thing in the inventory, it will turn off that inventory wrote the amount I want to withdraw. Currently, the only thing that came to my mind is that I set a certain variable to true as soon as I click on a certain item in the vinar menu. As soon as I click on it, the variable starts and in the chat it starts to capture the amount and it adds the amount to another variable. But. Castka registers with the variable but if I do
    add {vineyard :: player ::% player's uuid%} to {economy :: balance :: policedep}
    that's not how it works. Its not working without uuid players too. Thank you for your help

    Skript code:

    command /frakcevinice:
    trigger:
    open virtual chest inventory with size 1 named "&c&lFrakcni menu vinice" to player
    format gui slot 0 of player with gold ingot named "&6&lFrakcni penize - &a%{economy::balance::emoji_stuck_out_tongue:olicedep}%$"
    format gui slot 4 of player with tripwire hook named "&c&lxxx"
    format gui slot 8 of player with book and quill named "&2&lManagment zamestnancu"

    on inventory click:
    if clicked inventory isn't player's inventory:
    if inventory name of player's current inventory is "&c&lFrakcni menu vinice":
    clicked slot = 0:
    open virtual chest inventory with size 1 named "&c&lVinice - Penize" to player
    format gui slot 3 of player with gold ingot named "&c&lVybrat penize"
    format gui slot 8 of player with gold ingot named "&c&lVlozit penize"

    on inventory click:
    if clicked inventory isn't player's inventory:
    if inventory name of player's current inventory is "&c&lVinice - Penize":
    clicked slot = 3:
    send "&c&lVINICE &7Napis do chatu castku, kterou chces vybrat"
    close player's inventory
    set {vinice::emoji_stuck_out_tongue:layer} to true
    wait 4 second
    add {vinice::emoji_stuck_out_tongue:layer::%player's uuid%} to {economy::balance::emoji_stuck_out_tongue:olicedep}

    on chat:
    if {vinice::emoji_stuck_out_tongue:layer::%player's uuid%} is true:
    set {vinice::emoji_stuck_out_tongue:layer::%player's uuid%} to message

    Code in pastebin
    https://pastebin.com/Sqcy4cVU
     
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    337
    Likes Received:
    22
    Next time, put your code in a code box, so you don't have to upload it to pastebin. I don't understand what you ment with:
    "But. Castka registers with the variable but if I do
    add {vineyard :: player ::% player's uuid%} to {economy :: balance :: policedep}
    that's not how it works. Its not working without uuid players too. Thank you for your help"
     
  3. KorixCZ

    KorixCZ Member

    Joined:
    Jun 29, 2021
    Messages:
    4
    Likes Received:
    0
    Thus. I would need to do this so that the faction of the vineyard, which is called the vinice, took the amount that was recorded in the chat and added it to the player's balance
     
  4. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    337
    Likes Received:
    22
    Still not sure, but if you mean that it won't work try this:
    Code (Text):
    1. on chat:
    2.     if {vinice::player::%player's uuid%} is true:
    3.         set {vinice::player::%player's uuid%} to "%message%" parsed as a number
     

Share This Page

Loading...