Solved parse error

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

CziSKY

Member
Feb 22, 2017
25
0
0
20
China
www.15imc.com
code_language.skript:
on damage:
    set {_d::*} to lore of attacker's tool parsed as "%string%||Damage: +%number%||%String%"
    set damage to damage + {_d::2} parsed as number

[00:03:42] [Server thread/ERROR]: ': + %number%||%string%"' is not a valid item data (skylevel.sk, line 3: set {_d::*} to lore of attacker's tool parsed as "%string%||Damage: + %number%||%string%"')

please!!! thanks
 
`damage + 15` is just an example, you want any number to work right?
Also, is this coloured, and is this in a separate line? Which one counting from the top? Or is it the only text in the lore?
 
`damage + 15` is just an example, you want any number to work right?
Also, is this coloured, and is this in a separate line? Which one counting from the top? Or is it the only text in the lore?
yes i want any number to work
....i forget uncoloured and it's not a separate line I want it to work any line
like plugin "Itemlorestats"
[doublepost=1500485404,1500482362][/doublepost]
`damage + 15` is just an example, you want any number to work right?
Also, is this coloured, and is this in a separate line? Which one counting from the top? Or is it the only text in the lore?
Please...! it's important for me QAQ
 
Try this:
code_language.skript:
on damage:
    set {_d::*} to lore of attacker's tool parsed as "%string%||Damage: +%number%||%string%" split at "||"
    set damage to damage + {_d::2} parsed as number
 
Try this:
code_language.skript:
on damage:
    set {_d::*} to lore of attacker's tool parsed as "%string%||Damage: +%number%||%string%" split at "||"
    set damage to damage + {_d::2} parsed as number
 

Attachments

  • QQ截图20170720024711.png
    QQ截图20170720024711.png
    4.7 KB · Views: 199
Perhaps something like this will work.

code_language.skript:
on damage of a zombie:
    if 2nd line of lore of attacker's tool is set:
        if 2nd line of lore of attacker's tool contains "Damage +":
            set {_lore} to 2nd line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
 
Perhaps something like this will work.

code_language.skript:
on damage of a zombie:
    if 2nd line of lore of attacker's tool is set:
        if 2nd line of lore of attacker's tool contains "Damage +":
            set {_lore} to 2nd line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
If i do not want to limit it on 2nd line ?..
 
If i do not want to limit it on 2nd line ?..

I don't really know, except for simply repeating the code above for each line.

code_language.skript:
on damage of a zombie:
    if 1st line of lore of attacker's tool is set:
        if 1st line of lore of attacker's tool contains "Damage +":
            set {_lore} to 1st line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
    else if 2nd line of lore of attacker's tool is set:
        if 2nd line of lore of attacker's tool contains "Damage +":
            set {_lore} to 2nd line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
    else if 3rdd line of lore of attacker's tool is set:
        if 3rd line of lore of attacker's tool contains "Damage +":
            set {_lore} to 3rd line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
    else if 4th line of lore of attacker's tool is set:
        if 4th line of lore of attacker's tool contains "Damage +":
            set {_lore} to 4th line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
#Repeat for each line or lore.
#And on and on and on.......
 
I don't really know, except for simply repeating the code above for each line.

code_language.skript:
on damage of a zombie:
    if 1st line of lore of attacker's tool is set:
        if 1st line of lore of attacker's tool contains "Damage +":
            set {_lore} to 1st line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
    else if 2nd line of lore of attacker's tool is set:
        if 2nd line of lore of attacker's tool contains "Damage +":
            set {_lore} to 2nd line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
    else if 3rdd line of lore of attacker's tool is set:
        if 3rd line of lore of attacker's tool contains "Damage +":
            set {_lore} to 3rd line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
    else if 4th line of lore of attacker's tool is set:
        if 4th line of lore of attacker's tool contains "Damage +":
            set {_lore} to 4th line of lore of attacker's tool
            set {_subtext} to subtext of {_lore} from characters 10 to length of {_lore}
            set {_extradmg} to "%{_subtext}%" parsed as number
            increase damage by {_extradmg}
#Repeat for each line or lore.
#And on and on and on.......
oh :-( i I do not want to do that but thank you
 
code_language.skript:
set {_lore::*} to lore of attacker's tool split by "||"

loop {_lore::*}:
   
    set {_extraDamage} to first element of (uncolored loop-value parsed as "Damage: +%number%")

if {_extraDamage} is set:
    set damage to damage + {_extraDamage}
 
code_language.skript:
set {_lore::*} to lore of attacker's tool split by "||"

loop {_lore::*}:
  
    set {_extraDamage} to first element of (uncolored loop-value parsed as "Damage: +%number%")

if {_extraDamage} is set:
    set damage to damage + {_extraDamage}
Thank you
awesome answer!!!!!:-D
 
Status
Not open for further replies.