The latter is not an object - 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.

Justin Cason

New Member
May 15, 2019
5
0
1
33
Skript Version (do not put latest): Skript 2.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.13.2 Paper
---
Full Code:
Note: If the code is too large, feel free to use a pasting website (Pastebin or hastebin)
Note: If a variable is being set in another script, but not shown, please explain how they are being set


Code (Skript):
  1. Code:
    command /zombie:
      trigger:
        spawn 1 of zombie
        set name of last spawned zombie to "&8[&7Lvl 1&8] [&2★&8] &2Weak Zombie &a100&f/&a100&c❤"
        add "{CustomNameVisible:1,Small:1}" to nbt of last spawned entity
        fullheal(last spawned zombie, 10)
    
    command /testweapon:
      trigger:
        set {_x} to 1 wooden sword named "&8[&7Lvl 1&8] &7Starter Sword" with lore "&7Level: 1 / 5", "&7Damage: &c5", "" and "&7Gemstone Sockets [0 / 0]"
        add "{AttributeName:""generic.attackSpeed"", Name:""AttackSpeed"", Amount:100, Operation:0, UUIDLeast:1, UUIDMost:1}" to nbt of {_x}
        give player 1 of {_x} with no nbt
    
    function fullheal(e: entity, a: number):
      set max health of {_e} to {_a}
      broadcast "%{_e}% %{_a}%"
      set health of {_e} to {_a}
      broadcast "%Max health of {_e}% %health of {_e}%"
    
    on damage:
      attacker is a player
      if victim isn't a player:
        set {_x::*} to name of victim split at "&b&b"
        broadcast "%{_x::2}%"
        broadcast "%health of victim%"
        set {_lore::*} to lore of attacker's held item split at "||"
        loop {_lore::*}:
          if "%loop-value%" contains "Damage: ":
            set {_dmg} to loop-value
        broadcast "%{_dmg}%"
        wait 1 tick
        broadcast "%health of victim%"
  • Line 26: set {_lore::*} to lore of attacker's held item split at "||"
Errors on Reload:

Code (Skript):
  1. {_lore::*} can't be set to 'lore of attacker's held item split at "||"' because the latter is not an object (rpgp_core.sk line 26: set {_lore::*) to lore of attacker's held item split at "||"
Console Errors: (if applicable)

Code (Skript):
  1. None
Other Useful Info:

Addons using (including versions):
Sk-NBeeT, Tuske(Pickachu patch), SkQuery, Skellet, Skent, SkRayfall+v1.9.18, Skript-yaml, SkVault, Skript-Mirror. All are up to date with the latest for 1.13.2 Skript

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I have tried setting {_lore} to lore if attacker's item and then setting {_lore::*} to {_lore} split at "||" and other various things but none works.
 
Skript Version (do not put latest): Skript 2.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.13.2 Paper
---
Full Code:
Note: If the code is too large, feel free to use a pasting website (Pastebin or hastebin)
Note: If a variable is being set in another script, but not shown, please explain how they are being set


Code (Skript):
  1. Code:
    command /zombie:
      trigger:
        spawn 1 of zombie
        set name of last spawned zombie to "&8[&7Lvl 1&8] [&2★&8] &2Weak Zombie &a100&f/&a100&c❤"
        add "{CustomNameVisible:1,Small:1}" to nbt of last spawned entity
        fullheal(last spawned zombie, 10)
    
    command /testweapon:
      trigger:
        set {_x} to 1 wooden sword named "&8[&7Lvl 1&8] &7Starter Sword" with lore "&7Level: 1 / 5", "&7Damage: &c5", "" and "&7Gemstone Sockets [0 / 0]"
        add "{AttributeName:""generic.attackSpeed"", Name:""AttackSpeed"", Amount:100, Operation:0, UUIDLeast:1, UUIDMost:1}" to nbt of {_x}
        give player 1 of {_x} with no nbt
    
    function fullheal(e: entity, a: number):
      set max health of {_e} to {_a}
      broadcast "%{_e}% %{_a}%"
      set health of {_e} to {_a}
      broadcast "%Max health of {_e}% %health of {_e}%"
    
    on damage:
      attacker is a player
      if victim isn't a player:
        set {_x::*} to name of victim split at "&b&b"
        broadcast "%{_x::2}%"
        broadcast "%health of victim%"
        set {_lore::*} to lore of attacker's held item split at "||"
        loop {_lore::*}:
          if "%loop-value%" contains "Damage: ":
            set {_dmg} to loop-value
        broadcast "%{_dmg}%"
        wait 1 tick
        broadcast "%health of victim%"
  • Line 26: set {_lore::*} to lore of attacker's held item split at "||"
Errors on Reload:

Code (Skript):
  1. {_lore::*} can't be set to 'lore of attacker's held item split at "||"' because the latter is not an object (rpgp_core.sk line 26: set {_lore::*) to lore of attacker's held item split at "||"
Console Errors: (if applicable)

Code (Skript):
  1. None
Other Useful Info:

Addons using (including versions):
Sk-NBeeT, Tuske(Pickachu patch), SkQuery, Skellet, Skent, SkRayfall+v1.9.18, Skript-yaml, SkVault, Skript-Mirror. All are up to date with the latest for 1.13.2 Skript

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I have tried setting {_lore} to lore if attacker's item and then setting {_lore::*} to {_lore} split at "||" and other various things but none works.
I recommend you to update your Skript version to 2.4.1, many bugs have been fixed since your version.
If you have 2.4.1, you can use `set {_lore::*} to lore of tool of attacker`
 
Yea I just updated to 2.4.1 just a few mins ago and updated my server as well to 1.14.4. Same error though, so I will try that now what you recommended. I will let you know!
[doublepost=1577195176,1577194199][/doublepost]
I recommend you to update your Skript version to 2.4.1, many bugs have been fixed since your version.
If you have 2.4.1, you can use `set {_lore::*} to lore of tool of attacker`
Still the same error on reload hasn't changed.
 
Yea I just updated to 2.4.1 just a few mins ago and updated my server as well to 1.14.4. Same error though, so I will try that now what you recommended. I will let you know!
[doublepost=1577195176,1577194199][/doublepost]
Still the same error on reload hasn't changed.
Can you send the error (make sure you're using the code I sent you in the previous message)
 
Can you send the error (make sure you're using the code I sent you in the previous message)
ERROR is:
{_lore::*} can't be set to 'lore of attacker's held item split at "||"' because the latter is not an object (rpgp_core.sk line 26: set {_lore::*) to lore of attacker's held item split at "||"

However I did find a workaround, I set the lore to
Code:
set {_x} to 1 wooden sword named "&8[&7Lvl 1&8] &7Starter Sword" with lore "&7Level: 1 / 5", "&7Damage: &c5", "" and "&7Gemstone Sockets [0 / 0]"

And that fixed it where I don't need to split at "||"
 
ERROR is:
{_lore::*} can't be set to 'lore of attacker's held item split at "||"' because the latter is not an object (rpgp_core.sk line 26: set {_lore::*) to lore of attacker's held item split at "||"

However I did find a workaround, I set the lore to
Code:
set {_x} to 1 wooden sword named "&8[&7Lvl 1&8] &7Starter Sword" with lore "&7Level: 1 / 5", "&7Damage: &c5", "" and "&7Gemstone Sockets [0 / 0]"

And that fixed it where I don't need to split at "||"
Yea if that works it's good.
If you want to store lore in a list next time, use `set {_lore::*} to lore of tool of attacker`, as I said before.
 
Status
Not open for further replies.