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 PAPI problem and placeholder amount

Discussion in 'Skript' started by nicolas toledo, Jun 27, 2021.

Thread Status:
Not open for further replies.
  1. nicolas toledo

    Joined:
    Mar 29, 2020
    Messages:
    28
    Likes Received:
    0
    Hi guys, I am trying to detect the quantity of a placeholder and know if it is greater than a number. Here is the example of what I want to do, but it does not detect the number, however if I send a message with % {_ mana}% it sends the exact number of the amount I have at the moment.

    Code (Text):
    1. #does not detect that it is greater than 46
    2.  
    3.       set {_mana} to placeholder "%%heroes_mana%%" from player    
    4.       if {_mana} is greater than 46:
     
  2. Best Answer:
    Post #2 by Minecoll_YT, Jun 27, 2021
  3. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    You have to parse it first, because the outcome is a string and therefor cannot be compared with an integer.
    Code (Text):
    1. set {_mana} to placeholder "%%heroes_mana%%" from player parsed as a number
    or
    Code (Text):
    1. set {_mana} to placeholder "%%heroes_mana%%" from player
    2. set {_fmana} to {_mana} parsed as a number
     
  4. nicolas toledo

    Joined:
    Mar 29, 2020
    Messages:
    28
    Likes Received:
    0

    You are a genius, thank you!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...