Add text after item name

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

mac93

Member
Apr 19, 2024
3
0
1
48
Code:
Command /signitem [<text>]:
    permission: signitem.use
    permission message: &cYou do not have permission to this command!
    Trigger:
        if player's tool is not air:
            if arg-1 is set:
                set name of player's tool to colored arg-1
            else:
                message "&cYou didn't type a name for the item!"
        else:
            message "&cYou don't have any item in your hand!"

I have browsed the internet and forums and couldn't find exactly what I was trying to do.

I am trying to pull the current item in hand name and then add text after it with color being an option. Basically allowing a player to sign someone's item without touching the item name or format. I did try using a colored arg 2 but could never get it to work.
 
You can take the name of their tool and then tack on colored arg to the end.

Also no need to check if arg-1 is set and send a message if its not, just make the argument required.
 
Code:
Command /si [<text>][<text>]:
    permission: signitem.use
    permission message: &cYou do not have permission to this command!
    trigger:
        if arg-1 is set:
            set {_toolname} to name of player's tool to arg-2

this is what I have as of now. I started over. Am I headed in the right direction?

Removing the arg-1 set line.
 
No, I don't think so.

You'll want to use
set name of player's tool to "%name of player's tool% [%colored arg-1%]"
So you can add arg-1 to the end.

You should only need one text argument.
Also make sure it's a required argument.
<text>
instead of
[<text>]
 
  • Like
Reactions: mac93
No, I don't think so.

You'll want to use
set name of player's tool to "%name of player's tool% [%colored arg-1%]"
So you can add arg-1 to the end.

You should only need one text argument.
Also make sure it's a required argument.
<text>
instead of
[<text>]
Thank you for showing me that! I didn't realize that on the <text> section for being required. Appreciate the help.