Solved Lore to number please 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
So I'm making a custom shop with fish, I'm really close, but I'm now stuck. The fish have lengths, and I am able to get the numbers I need, but they are in quotes and so, can't be used to do math (to give the money) I'm new to Skript, and would appreciate any help!!! Thx. Here's my code.
Code:
on right click:
  set {_SellMultiplier} to 1
  if lore of held item contains "&7Caught":
    set {_Money1} to 10
    if lore of held item contains "&7Caught": 
      if held item's lore contains "cm":
        delete line 2 of held item's lore
        set line 1 of held item's lore to regex replace all "cm" with "" in held item's lore
        set {_lore} to line 1 of held item's lore
        send line 1 of held item's lore to player
      set {_Money2} to line 1 of held item's lore
      set {_Money3} to "%{_SellMultiplier}*{_Money2}+{_Money1}%"
      if player's held item is cod:
        add 10 to balance of player
 
If a string has " in it you can use replace. Otherwise you can use set {xyz} to {abc} parsed as a number.
 
Status
Not open for further replies.