Solved Checking number in player's tool lore?

  • 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 community!

    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.

Aryaz25

Member
Apr 6, 2017
23
0
1
Hello! I tried to check the number in player's tool lore with this command

code_language.skript:
command /test:
    trigger:
        set {_split::*} to uncoloured line 1 of player's tool's lore parsed as "Damage: %number%"
        send "%{_split::1}%" to the player

But when i test it out, it only said "<none>"
The output should said the number in player's tool's lore. No error when i reload the skript.

Do anyone knows what happened?

Thanks!
 
Hello! I tried to check the number in player's tool lore with this command

code_language.skript:
command /test:
    trigger:
        set {_split::*} to uncoloured line 1 of player's tool's lore parsed as "Damage: %number%"
        send "%{_split::1}%" to the player

But when i test it out, it only said "<none>"
The output should said the number in player's tool's lore. No error when i reload the skript.

Do anyone knows what happened?

Thanks!

you mean %number% ?
if that, change %{_split::1}% to the player to %number%
 
Could you show us the first line of the lore? And what version of Skript/your server is running?
 
code_language.skript:
command /test:
    trigger:
        set {_split::*} to uncoloured line 1 of player's tool's lore split at " "
        send "%{_split::2}%" to the player

Remember that {_split::2} is a text. Parse it as a number to do math:
code_language.skript:
{_split::2} parsed as number
 
  • command /test:
  • trigger:
  • set {_split::*} to uncoloured line 1 of player's tool's lore split at " "
  • send "%{_split::2}%" to the player

OMG IT WORKS! Never thought to do it like that xD

Thanks xUndefined!
 
You can also use Skellett which makes this easy and not in a list.

code_language.skript:
command /test:
    trigger:
        Broadcast "%numbers of uncoloured line 1 of player's tool's lore%"
 
  • command /test:
  • trigger:
  • Broadcast "%numbers of uncoloured line 1 of player's tool's lore%"

Never knew an expression such like that existed xD

Btw, if i got 2 numbers in my lore, example: Damage: 22-27. How can i get each of them?

I already tried to put them in list but dont know how to parse them as numbers :/

Edit:
Nvm i managed to do it
 
Last edited by a moderator:
You can also use Skellett which makes this easy and not in a list.

code_language.skript:
command /test:
    trigger:
        Broadcast "%numbers of uncoloured line 1 of player's tool's lore%"
What prompted you to add this? it seems so... random
 
What prompted you to add this? it seems so... random
I needed it for string stuff. Mainly custom menu stuff for slots etc. It's super helpful to me.

Alot easier than using 3 lines to split and get. I love it.
 
Status
Not open for further replies.