name of item in 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.

Kush

Member
Jan 29, 2017
29
2
3
28
I have a weird issue here, I have this piece of code i'v been using in my skripts and now all of the sudden it's no longer working. With this example I know I can just get the name directly from the player's tool but that won't be the case for what I actually need it for.

I am setting an item to a variable then returning the name of the item from that variable.

Code:
command /test:
    trigger:
        set {_item} to player's tool
        set {_n} to name of {_item}
        send "%{_item}%"
        send "%{_n}%"

So when I return {_item} it's working correctly, however "Set {_n} to name of {_item}" is not.

I haven't changed versions or anything since it has broken, just added two skript addons: Vixio & SkriptMirror
Maybe one of those two or both broke this? I'm not sure!

Any help would be appreciated, thanks.
 
Settings a variable to an item's name will ONLY work if the item has a custom name.

For instance, I have a wooden sword named "&3Sharpened Stick" and I use this command, it would set {_item} to "Wooden Sword named '&3Sharpened Stick'" and then {_n} would be set to "&3Sharpened Stick"
 
Status
Not open for further replies.