Skript Math Help

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

SmallDev

Member
Apr 6, 2020
39
0
6
Every time I try and do math with variables I get 0 as a result.
Code:
on right click:
  if lore of held item contains "&7Caught":
    set {Money1} to "10"
    if lore of held item contains "48.8cm":
      set {Money2} to "48.8"
      set {Money3} to "%{Money2}+{Money1}%" 
      if player's held item is cod:
        add 10 to balance of player
        send "%{Money3}%" to player
        delete {Money::*}
        remove 1 of tool from tool
Any help would be appreciated thanks.
 
Every time I try and do math with variables I get 0 as a result.
Code:
on right click:
  if lore of held item contains "&7Caught":
    set {Money1} to "10"
    if lore of held item contains "48.8cm":
      set {Money2} to "48.8"
      set {Money3} to "%{Money2}+{Money1}%"
      if player's held item is cod:
        add 10 to balance of player
        send "%{Money3}%" to player
        delete {Money::*}
        remove 1 of tool from tool
Any help would be appreciated thanks.
That's HILARIOUS
from when math works with strings :emoji_sleepy:
look at what you did
Code:
set {Money1} to "10"
do you know the difference between a text and a number, right ?
you can save a number type to Skript variables
Code:
set {variable} to 10
 
Status
Not open for further replies.