Solved How to make nick skript

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

Senku

New Member
Jun 11, 2020
6
0
1
Hello, im working on a /nick skript and it just wont work no matter what, so i need help

Code:
variables:
        {nick} = false
        {name} = text
on chat:
    if {nick} is true:
        cancel event
        broadcast "&8[&fPlayer&8] &f{name} &8» &f%message%"
        set tab list name of player to "&8[&fPlayer&8] &f{name}"
        stop

command /nick <text>:
    usage: &fWrong usage&c! &7/nick <name/off>
    description: Used to set a nick name
    permission: jellyfarms.nick
    aliases: /nickname, /newname, /name
    trigger:
        if arg-1 is set:
            if arg-1 is "off":
                player has permission "staff.staff":
                    message "&fNick disabled&c!"
                    set {nick} to false
                    set tab list name of player to "&cStaff &f| %player%"
                player has permission "yt.yt":
                    message "&fNick disabled&c!"
                    set {nick} to false
                    set tab list name of player to "&fYou&cTube &f| %player%"
            else:
                message "&fNick set as &c%arg-1%&f!"
                set {nick} to true
                set {name} to arg-1
When i nick the name in chat is {name} instead of arg-1 same for tab, no errors when reloaded
 
You need to put % in a string when it includes a var.

Code:
on chat:
    if {nick} is true:
        cancel event
        broadcast "&8[&fPlayer&8] &f%{name}% &8» &f%message%"
        set tab list name of player to "&8[&fPlayer&8] &f%{name}%"
        stop
 
Status
Not open for further replies.