1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

The latter is not an object - help

Discussion in 'Skript' started by Justin Cason, Dec 24, 2019.

Thread Status:
Not open for further replies.
  1. Justin Cason

    Justin Cason New Member

    Joined:
    May 15, 2019
    Messages:
    5
    Likes Received:
    0
    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 (Text):
      1. command /zombie:
      2.   trigger:
      3.     spawn 1 of zombie
      4.     set name of last spawned zombie to "&8[&7Lvl 1&8] [&2★&8] &2Weak Zombie &a100&f/&a100&c❤"
      5.     add "{CustomNameVisible:1,Small:1}" to nbt of last spawned entity
      6.     fullheal(last spawned zombie, 10)
      7.  
      8. command /testweapon:
      9.   trigger:
      10.     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]"
      11.     add "{AttributeName:""generic.attackSpeed"", Name:""AttackSpeed"", Amount:100, Operation:0, UUIDLeast:1, UUIDMost:1}" to nbt of {_x}
      12.     give player 1 of {_x} with no nbt
      13.  
      14. function fullheal(e: entity, a: number):
      15.   set max health of {_e} to {_a}
      16.   broadcast "%{_e}% %{_a}%"
      17.   set health of {_e} to {_a}
      18.   broadcast "%Max health of {_e}% %health of {_e}%"
      19.  
      20. on damage:
      21.   attacker is a player
      22.   if victim isn't a player:
      23.     set {_x::*} to name of victim split at "&b&b"
      24.     broadcast "%{_x::2}%"
      25.     broadcast "%health of victim%"
      26.     set {_lore::*} to lore of attacker's held item split at "||"
      27.     loop {_lore::*}:
      28.       if "%loop-value%" contains "Damage: ":
      29.         set {_dmg} to loop-value
      30.     broadcast "%{_dmg}%"
      31.     wait 1 tick
      32.     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.
     
  2. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    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`
     
  3. Justin Cason

    Justin Cason New Member

    Joined:
    May 15, 2019
    Messages:
    5
    Likes Received:
    0
    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!
    --- Double Post Merged, Dec 24, 2019, Original Post Date: Dec 24, 2019 ---
    Still the same error on reload hasn't changed.
     
  4. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    Can you send the error (make sure you're using the code I sent you in the previous message)
     
  5. Justin Cason

    Justin Cason New Member

    Joined:
    May 15, 2019
    Messages:
    5
    Likes Received:
    0
    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 (Text):
    1. 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 "||"
     
  6. TPGamesNL

    Moderator Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    108
    Medals:
    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.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...