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.

Solved Custom Command Help

Discussion in 'Skript' started by Only_Dans, Dec 19, 2021.

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

    Only_Dans Member

    Joined:
    Dec 19, 2021
    Messages:
    4
    Likes Received:
    0
    I am trying to create a command that will respawn the player for a cost of $10000 by typing /respawn. I am using the vault plugin for the economy. I can't get it to work correctly. This is my skript currently.

    command /rsp:
    description: This will buy you back to life for $10000
    permission: sk.respawn
    permission message: &cYou cannot preform this command!
    trigger:
    if player's %vault_eco_balance% is greater than or equal to 10000:
    remove 10000 from player's %vault_eco_balance%
    set player's gamemode to survival
    message "You have been revived!" to player
    if player's %vault_eco_balance% is greater than or equal to 10000:
    message "You don't have enough money!" to player

    When I reload the script in game it tells me this

    Can't compare 'player's %vault_eco_balance%' with an integer (Respawn.sk, line 6: if player's %vault_eco_balance% is greater than or equal to 10000:')
    Can't compare 'player's %vault_eco_balance%' with an integer (Respawn.sk, line 10: if player's %vault_eco_balance% is lesser than 10000:')

    Can someone explain why I can't get it to run?

     
  2. Best Answer:
    Post #6 by ayden colon, Dec 20, 2021
  3. yea rite

    yea rite Active Member

    Joined:
    Jul 11, 2021
    Messages:
    73
    Likes Received:
    5
    try using %player's vault_eco_balance%
     
  4. Only_Dans

    Only_Dans Member

    Joined:
    Dec 19, 2021
    Messages:
    4
    Likes Received:
    0
    Same error
     
  5. ayden colon

    ayden colon Member

    Joined:
    Dec 16, 2021
    Messages:
    3
    Likes Received:
    0
    try


    command /rsp:
    description: This will buy you back to life for $10000
    permission: sk.respawn
    permission message: &cYou cannot preform this command!
    trigger:
    if balance of player <= 10000:
    remove 10000 from the player's account
    set player's gamemode to survival
    message "You have been revived!" to player
    if balance of player <= 10000:
    message "You don't have enough money!" to player
     
  6. Only_Dans

    Only_Dans Member

    Joined:
    Dec 19, 2021
    Messages:
    4
    Likes Received:
    0
    That made it work. Thank you
    --- Double Post Merged, Dec 20, 2021, Original Post Date: Dec 20, 2021 ---

    It doesn't error out anymore but it only works if I have exactly 10000. If I have more then that it tells me "You don't have enough money!" Is there another way to express greater than or equal to?
     
  7. ayden colon

    ayden colon Member

    Joined:
    Dec 16, 2021
    Messages:
    3
    Likes Received:
    0
    well try
    --- Double Post Merged, Dec 20, 2021 ---
    command /rsp:
    description: This will buy you back to life for $10000
    permission: sk.respawn
    permission message: &cYou cannot preform this command!
    trigger:
    if balance of player < 10000:
    remove 10000 from the player's account
    set player's gamemode to survival
    message "You have been revived!" to player
    if balance of player < 10000:
    message "You don't have enough money!" to player
     
Thread Status:
Not open for further replies.

Share This Page

Loading...