"if lore of attacker's tool" condition not working?

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

Idiosyncratic

Member
Feb 21, 2017
62
0
0
20
USA
I reload the script and get no errors, am I coding something wrong?


code_language.skript:
on damage of entity:
 attacker's tool is a sword
 if lore of attacker's tool is "&7Damage: &r255":
  set damage to 127.5
 
2017-04-15_01.04.38.png
 
If it's only the first line then you can try:
code_language.skript:
if uncolored line 1 of lore of attacker's tool is "Damage: 255":
 
Miscommunication on my part, I actually wanted to add more stats per weapon/tool, is there any way to do this? I tried adding "if uncolored line 2 of lore of attacker's tool is ______" but it just seems to cancel out my previous effect.
 
Miscommunication on my part, I actually wanted to add more stats per weapon/tool, is there any way to do this? I tried adding "if uncolored line 2 of lore of attacker's tool is ______" but it just seems to cancel out my previous effect.
Well, the method I always use for this kind of stuff is this one:
code_language.skript:
loop lore of attacker's tool split by "||":
    set {_value} to uncolored loop-text parsed as "(Damage|Amount|Points|Keep adding keys here): %number%"
    if {_value} is set:
        add {_value} to {_values::*}
Now if your lore is like:
code_language.skript:
Damage: 255
Amount: 10
Points: 12
The {_values::*} car will contain all these numbers without the key.
 
So I need to add all that after my "on damage" event?

With this code:
code_language.skript:
on damage:
 loop lore of attacker's tool split by "||":
  set {_value} to uncolored loop-text parsed as "(Damage|Amount|Points): %number%"
  if {_value} is set:
   add {_value} to {_values::255|10|12}

I get this error:
error.PNG
 
Last edited by a moderator:
Status
Not open for further replies.