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 Nickname

Discussion in 'Skript' started by TullyMastully, Aug 28, 2017.

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

    TullyMastully Member

    Joined:
    Aug 9, 2017
    Messages:
    38
    Likes Received:
    0
    Hey, I've been making a skript command, although when I nick myself, this happens (See Picture)
    It shows twice the nicked username.

    Code (Skript):
    1.  
    2. on chat:
    3.     if {Name.%UUID of player%} is {Name.%UUID of player%}:
    4.         broadcast "&9%{Name.%UUID of player%}% &8» &f%message%"
    5.     else:
    6.         #This one is for my ranking system
    7.         broadcast "%{tullycore.rank.%player%}%%player% &8» &f%message%"
    8.  
    9. #Nick command
    10. command /nick [<text>]:
    11.     permission: tullycore.nick
    12.     permission message: &a&lTULLYCORE &cYou can't execute this command, You need to be the VIP rank or higher!
    13.     trigger:
    14.         if arg is not set:
    15.             send "{@secprefix} &cIncorrect usage, Try /nick (Username)"
    16.         if arg 1 is "iJoin":
    17.             send "{@secprefix} &cCan't nick yourself as iJoin."
    18.         if arg 1 is "off":
    19.             set player tab name to "%{tullycore.rank.%player%}%%player%"
    20.             set player's display name to "%{tullycore.rank.%player%}%%player%"
    21.             message "{@secprefix} &aYou are no longer nicked!"
    22.             clear {Name.%UUID of player%}
    23.         if arg 1 is not "off":
    24.             set player's display name to "&9%arg 1%"
    25.             set player tab name to "&9%arg 1%"
    26.             send "{@secprefix} &aYou are now nicked as %arg 1%!" to player
    27.             set {Name.%UUID of player%} to arg 1
    28.            
    29.  
    30.    
    31. on join:
    32.     set player tab name to {Name.%UUID of player%}
    33.     set player's display name to {Name.%UUID of player%}
    34.  
    35.  
     

    Attached Files:

  2. Best Answer:
    Post #2 by ShaneBee, Aug 28, 2017
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    You need to cancel the chat event then broadcast the message
    Code (Skript):
    1. on chat:
    2.     if {Name.%UUID of player%} is {Name.%UUID of player%}:
    3.         cancel event
    4.         broadcast "&9%{Name.%UUID of player%}% &8» &f%message%"
    5.     else:
    6.         #This one is for my ranking system
    7.         cancel event
    8.         broadcast "%{tullycore.rank.%player%}%%player% &8» &f%message%"
    unrelated side-note: idk if it was a typo but checking if {Name.%UUID of player%} is {Name.%UUID of player%} (line 3 in original code) is pointless because itll always be true since its the same variable. its like asking if 1 = 1
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    You don't even know how much I've been working on it, but every time it's just not working, but you helped me and now it's working!
    Thanks so much!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...