Solved PAPI problem and placeholder amount

  • 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.
Mar 29, 2020
28
0
1
28
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:
#does not detect that it is greater than 46

      set {_mana} to placeholder "%%heroes_mana%%" from player     
      if {_mana} is greater than 46:
 
You have to parse it first, because the outcome is a string and therefor cannot be compared with an integer.
Code:
set {_mana} to placeholder "%%heroes_mana%%" from player parsed as a number
or
Code:
set {_mana} to placeholder "%%heroes_mana%%" from player
set {_fmana} to {_mana} parsed as a number
 
You have to parse it first, because the outcome is a string and therefor cannot be compared with an integer.
Code:
set {_mana} to placeholder "%%heroes_mana%%" from player parsed as a number
or
Code:
set {_mana} to placeholder "%%heroes_mana%%" from player
set {_fmana} to {_mana} parsed as a number


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