Finding values

  • 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.
Apr 2, 2023
2
0
1
40
Hello! I need help finding specific values in a string.
Line type:
&7[&e★ 15&7] Zombie
You only need to get the value of the level, in the example it is 15.
But the main problem is that the level can be at least 1, at least 999.
Please help me.
 
Hello, here is an example script:
Code:
on damage:
    set {_name} to uncolored name of victim:
    if {_name} contains "Zombie":
        replace "[" and "★ " and "] " and "Zombie" with "" in {_name}
        set {_level} to {_name} parsed as number
        send "Level of Zombie is %{_level}%" to attacker
Next time, follow the format of the post, please
 
Hello, here is an example script:
Code:
on damage:
    set {_name} to uncolored name of victim:
    if {_name} contains "Zombie":
        replace "[" and "★ " and "] " and "Zombie" with "" in {_name}
        set {_level} to {_name} parsed as number
        send "Level of Zombie is %{_level}%" to attacker
Next time, follow the format of the post, please
Hello, thanks for your help, but this answer does not suit me, because the name of the monster can be anything - it does not have to be a zombie.
And for the form of the message, I'm sorry if I wrote something wrong. I have tried to describe everything that may be required.
 
Status
Not open for further replies.