name of item from variable

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

feerko

Member
Feb 19, 2017
70
1
0
28
hello, i have a weird issue with name of item

Code:
command /test:
  trigger:
    add book named "&bitem1" with lore "lore1" to {_items::*}
    add book named "&bitem2" with lore "lore2" to {_items::*}
    add book named "&bitem3" with lore "lore3" to {_items::*}

    set {_rand} to random element out of {_items::*}
    broadcast "name: %name of {_rand}%" #none
    broadcast "lore: %lore of {_rand}%" #works

name of {_rand} returns <none> but lore works.
 
I don't think you can add it in the way you want to. I got it to work while holding an item with a name and lore, but as soon as you scroll off it it stops. It definitely seems bugged.
code_language.skript:
command /test:
    trigger:
        set {_item} to player's tool
        add {_item} to {_items::*}
        set {_rand} to random element out of {_items::*}
        broadcast "name: %name of {_rand}%" #none
        broadcast "lore: %lore of {_rand}%" #works
b92a8956ba.png
 
Status
Not open for further replies.