Nickname Script

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

Kolsenstein

Member
Jul 1, 2021
4
0
1
20
Category: Request

Suggested name: RPname

Spigot/Skript Version: latest

What I want:
Hello random user, Im very very new to skript and know basically nothing. Im struggling to find a script to change the nickname of the player above their head and in chat and in Tablist. Yes I do have Tablisknu installed but it seems that all scripts I find are outdated. Can someone please help me or send me a script. I want this to happen when I use the command /rpname [<text>]

Ideas for commands: /rpname [<text>]

Ideas for permissions: rp.name

When I'd like it by: Any time really, im in no rush
 
Last edited:
Code:
# Made by Frog#2803
command rpname [<text>]:
  permission: rp.name
  trigger:
    if arg-1 isn't set:
      send "&8[&aRolePlay&8]&r Please choose a &anickname!" to player
    if arg-1 is set:
      if arg-1 contains " ":
        send "&8[&aRolePlay&8]&r Your &anickname&r can't contain spaces!" to player
        stop
      if length of arg-1 is above 16:
        send "&8[&aRolePlay&8]&r Your &anickname&r can't contain more than 16 characters!" to player
        stop
      else:
        set display name of player to arg-1
        set tab list name of player to arg-1
        send "&8[&aRolePlay&8]&r Successfully set your &anickname&r to &a%arg-1%!" to player

command rpreset:
  permission: rp.name
  trigger:
    reset display name of player
    reset tab list name of player
    send "&8[&aRolePlay&8]&r Successfully reset your &anickname!" to player

does this work?
 
Last edited:
This code is not tested because I was bored in school, and I can't go to Minecraft.

Code:
command /nick <text>:
    permission: nick.use
    trigger:
        if arg 1 contains " ":
            send "no spacaes"
        else if length of arg 1 is above 16:
            send "to long"
        else if arg 1 is "reset":
            reset display name of player
            reset tab list name of player
            send "reseted nick"
        else:
            set display name of player to colored arg 1
            set tab list named of player to colored arg 1
            send "renamed to %arg 1%"
 
Heres something I did for someone else. It'll save their nickname upon joining also.


Code:
Options:
 
  # Basic Configuration
 
  MaxLength: 15
  MinLength: 4
  AllowColorNames: true
  ChangeTabName: true
 
  # Permission Section.
 
  ColorNickPermission: "CoolPermission.Coolness"
  CommandUsagePerm: "ReallyCool.Permission"
 
  # Messages
 
  NoPerm: "&cYou do not have permission to use this command!"
  Forbidden: "&cYou cannot use color codes in your nickname!"
  InvalidChar: "&cYou've used a Forbidden Letter, or Word!"
  TooLong: "&cYour nickname is too long!"
  TooShort: "&cYour nickname is too short!"
  InvalidArg: "&cYou're missing Arguments &b/nick <name>"
 
  # Prefix
 
  Prefix: &c[&7Nickname&c] &7
 
command /nickAdmin [<text>] [<text>]:
  trigger:
    if player is op:
      if arg 1 is not set:
        if arg 2 is not set:
          send "--------- {@Prefix} ---------"
          send "&c"
          send "&b/nickAdmin add [<Char>] &7: &cWill add a forbidden character"
          send "&b/nickAdmin remove [<Char>] &7: &cWill remove a forbidden character"
          send "&b/nickAdmin list &7: &cWill display forbidden characters"
          send "&c"
          stop
      if arg 1 is "add":
        if arg 2 is set:
          add arg 2 to {forbiddenChars::list::*}
          send "{@Prefix} Added &b&l%arg 2% &7to forbidden char list"
        else:
          send "Specify a Char, or Word"
      if arg 1 is "remove":
        if arg 2 is set:
          if {forbiddenChars::list::*} contains arg 2:
            remove arg 2 from {forbiddenChars::list::*}
            send "{@Prefix} You've removed &b&l%arg 2%&7 from the Forbidden Word / Char List"
          else:
            send "{@Prefix} Word, or Letter not found!"
        else:
          send "{@Prefix} Specify a Word, or Letter. For a list do &b/nickAdmin list"
       
      if arg 1 is "list":
        if {forbiddenChars::list::*} != 0:
          send {forbiddenChars::list::*} to player
        else:
          send "&cThere are no forbidden chars"
 
command /nick [<text>]:
  trigger:
    if player has permission {@CommandUsagePerm}:
      if length of arg 1 > {@MaxLength}:
        send {@TooLong}
        stop
      if length of arg 1 < {@MinLength}:
        send {@TooShort}
        stop
      if arg 1 is "reset" or "Reset":
        set player's display name to player's name
        set player's tab list name to player's name
        set {nickname.%player%} to false
        send "{@Prefix} You've reset your Nickname"
        stop
      if arg 1 is set:
        if size of {forbiddenChars::list::*} > 0:
          if arg 1 contains {forbiddenChars::list::*}:
            send {@InvalidChar}
            stop
        else:
          if player has permission {@ColorNickPermission}:
            if {@ChangeTabName} = true:
              set player's tab list name to coloured arg 1
            set player's display name to coloured arg 1
            send coloured "{@Prefix} You set your name to %arg 1%"
            set {nickname.%player%} to arg 1
            stop
          set player's display name to arg 1
          set player's tab list name to arg 1
          set {nickname.%player%} to arg 1
          send "{@Prefix} You set your name to %arg 1%"
      else:
        send {@InvalidArg}
    else:
      send {@NoPerm}
     
     
on join:
  if {nickname.%player%} is set:
    if {nickname.%player%} != false:
      if player has permission {@ColorNickPermission}:
        set player's display name to coloured {nickname.%player%}
        send coloured "{@Prefix} Your current nickname is %player's display name%"
      else:
        set player's display name to {nickname.%player%}
        send coloured "{@Prefix} Your current nickname is %player's display name%"
 
Code:
# Made by Frog#2803
command rpname [<text>]:
  permission: rp.name
  trigger:
    if arg-1 isn't set:
      send "&8[&aRolePlay&8]&r Please chose a &anickname!" to player
    if arg-1 is set:
      if arg-1 contains " ":
        send "&8[&aRolePlay&8]&r Your &anickname&r can't contain spaces!" to player
        stop
      if length of arg-1 is above 16:
        send "&8[&aRolePlay&8]&r Your &anickname&r can't contain more than 16 characters!" to player
        stop
      else:
        set display name of player to arg-1
        set tab list name of player to arg-1
        send "&8[&aRolePlay&8]&r Succesfully set your &anickname&r to &a%arg-1%!" to player

command rpreset:
  permission: rp.name
  trigger:
    reset display name of player
    reset tab list name of player
    send "&8[&aRolePlay&8]&r Succesfully reset your &anickname!" to player

does this work?
No Offense, but your spelling is a bit off and there are probably way too many typo's for this to work.
 
No Offense, but your spelling is a bit off and there are probably way too many typo's for this to work.
I fixed my spelling mistakes but my script works.. idk if u wanted to reply to the person below me but ty for pointing out my dumb spelling mistakes