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 our 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 [BUG] Skript can't do basic math

Discussion in 'Skript' started by bigwillyman69, Oct 11, 2019.

Tags:
  1. b

    bigwillyman69 Member

    Joined:
    Aug 27, 2019
    Messages:
    17
    Likes Received:
    0
    Code:
    Code (Text):
    1. on right click with sunflower:
    2.     if name of player's tool contains "1", "2", "3", "4", "5", "6", "7", "8", "9" or "0":
    3.         set {_price::*} to the name of the player's held item split at "$"
    4.         if line 2 of lore of player's tool contains "Worth: %{_price::2}%":
    5.             add {_price::2} to player's balance
    6.             send "&a+%{_price::2}%" to player
    7.            
    8. command /withdraw <integer>:
    9.     trigger:
    10.         if arg-1 is an integer:
    11.             if player's balance is greater than or equal to %arg-1%:
    12.                 remove arg-1 from player's balance
    13.                 add 1 sunflower to player's inventory with name "&eCoin: %arg-1%" and lore "", "&7Worth: %arg-1%"
    14.         if arg-1 is not set:
    15.             send "&cInvalid arguments"
    Error:
    Can't compare a money with 'or equal to %arg-1%' (polycore.sk, line 221: if player's balance is greater than or equal to %arg-1%:')
     
  2. Best Answer:
    Post #2 by ShaneBee, Oct 11, 2019
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,052
    Likes Received:
    144
    This isn't a Skript bug, this is user error:
    Code (Text):
    1. if player's balance is greater than or equal to %arg-1%
    %% is only used within strings and variables.
     
Loading...