Solved if %player's money% is greater or equal to 2000:

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

AndrewKopera

Member
Mar 18, 2021
18
0
1
24
Skript version: 2.5.3
Server version:git-paper-529
Addons:Skellett v1.9.11, skRayFall v1.9.23, SkQuery v4.1.4, TuSKe v1.8.2, SharpSK v1.6.4

Hello, I am making a skript that you can buy someone out of jail. I have it almost done but i need to add money check. I added if %player's money% is greater or equal to 2000 but it says: "cant compare %player's money% with an integer. I have vault installed but it doesnt work.

Thanks for your help.
Code:
command /buyout <player>:
    trigger:
        if arg 1 is not set:
            send "&eYou have to write player's name." to player
            stop
        if arg 1 is set:
            if %player's money% is greater than or equal to 2000:
                send "&aYou have rescued  %arg 1% from jail." to player
                make server execute command "eco take %player% 2000"
                make server execute command "unjail %arg 1%"
                stop
            if %player's money% is lesser than or equal to 1999:
                send "&eYou dont have enough money.."
                stop

Solved:
Instead of %player's money% put player's balance without %.
for the if player's balance is lesser than or equal to 1999 dont put it there put: else :emoji_grinning:

New code looks like this:
Code:
command /buyout <player>:
    trigger:
        if arg 1 is not set:
            send "&eYou have to write name of the player." to player
            stop
        if arg 1 is set:
            if player's balance is greater than or equal to 2000:
                send "&aYou've rescued %arg 1%" to player
                make server execute command "eco take %player% 2000"
                make server execute command "unjail %arg 1%"
                stop
            else:
                send "&eYou dont have enough money." to player
                stop
 
Last edited:
What economy plugin are you using?
what economy plugins are there? I really dont know. I started working on a minecraft server when my developer left. Is it possible that shopguiplus works if i dont have economy plugin? Also i can do cmd /eco give. Is Vault economy plugin?

Thanks for help.
 
It sounds like you use vault, I can’t test this because I’m in bed right now, I may be able to help you further in the morning but instead of using percents use balance. E.g:

if player’s balance is greater than 2000:

idk Soz if it no work
 
It sounds like you use vault, I can’t test this because I’m in bed right now, I may be able to help you further in the morning but instead of using percents use balance. E.g:

if player’s balance is greater than 2000:

idk Soz if it no work
Thank you so much. It works now. But i have another problem now. This code doesnt work. It says: cant compare a money with ('lesser than' or 'equal to 1999'. How do i fix this?
Code:
if player's balance is lesser than or equal to 1999:
    send "&eYou dont have enough money."
    stop
 
Status
Not open for further replies.