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.

Solved How to make nick skript

Discussion in 'Skript' started by Senku, Jul 2, 2020.

Thread Status:
Not open for further replies.
  1. Senku

    Senku New Member

    Joined:
    Jun 11, 2020
    Messages:
    6
    Likes Received:
    0
    Hello, im working on a /nick skript and it just wont work no matter what, so i need help

    Code (Text):
    1. variables:
    2.         {nick} = false
    3.         {name} = text
    4. on chat:
    5.     if {nick} is true:
    6.         cancel event
    7.         broadcast "&8[&fPlayer&8] &f{name} &8» &f%message%"
    8.         set tab list name of player to "&8[&fPlayer&8] &f{name}"
    9.         stop
    10.  
    11. command /nick <text>:
    12.     usage: &fWrong usage&c! &7/nick <name/off>
    13.     description: Used to set a nick name
    14.     permission: jellyfarms.nick
    15.     aliases: /nickname, /newname, /name
    16.     trigger:
    17.         if arg-1 is set:
    18.             if arg-1 is "off":
    19.                 player has permission "staff.staff":
    20.                     message "&fNick disabled&c!"
    21.                     set {nick} to false
    22.                     set tab list name of player to "&cStaff &f| %player%"
    23.                 player has permission "yt.yt":
    24.                     message "&fNick disabled&c!"
    25.                     set {nick} to false
    26.                     set tab list name of player to "&fYou&cTube &f| %player%"
    27.             else:
    28.                 message "&fNick set as &c%arg-1%&f!"
    29.                 set {nick} to true
    30.                 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
     
  2. Best Answer:
    Post #2 by Detective Vapor, Jul 2, 2020
  3. Detective Vapor

    Joined:
    Jul 2, 2020
    Messages:
    15
    Likes Received:
    0
    You need to put % in a string when it includes a var.

    Code (Text):
    1. on chat:
    2.     if {nick} is true:
    3.         cancel event
    4.         broadcast "&8[&fPlayer&8] &f%{name}% &8» &f%message%"
    5.         set tab list name of player to "&8[&fPlayer&8] &f%{name}%"
    6.         stop
     
Thread Status:
Not open for further replies.

Share This Page

Loading...