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.

Nickname - Help

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

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

    TullyMastully Member

    Joined:
    Aug 9, 2017
    Messages:
    38
    Likes Received:
    0
    Skript Version: Skript 2.2
    Skript Author: TullyMastully
    Minecraft Version: 1.8

    ---
    Full Code:



    Code (Skript):
    1.  
    2. command /nick [<text>]:
    3.     permission: tullycore.nick
    4.     permission message: &a&lTULLYCORE &cYou can't execute this command, You need to be the VIP rank or higher!
    5.     trigger:
    6.         if arg is not set:
    7.             send "&cIncorrect usage, Try /nick (Username)"
    8.         if arg 1 is set:
    9.             if {tullycore.nickname.%player%} is not set:
    10.                 set player tab name to "&9%arg-1%"
    11.                 set {tullycore.rank.scoreboard.%arg 1%} to "&cNICKED"
    12.                 set {tullycore.nickname.%player%} to "%arg 1%"
    13.                 set player's display name to "%arg 1%"
    14.                 set player's tablist name to "%arg 1%"
    15.                 set {vanish.%player%} to true
    16.                 send "{@secprefix} &aYou are now nicked as %arg 1%!" to player
    17.                 stop
    18.  
    19. #Nickname Chat event
    20. on chat:
    21.     cancel event
    22.     broadcast "&9%{tullycore.nickname.%player%}% &8» &f%message%"
    23.  
    24. #Setrank Chat Event
    25. on chat:
    26.     cancel event
    27.     broadcast "%{tullycore.rank.%player%}%%player% &8» &f%message%"
    28.  
    29. #Make sure you read the "Other Useful Info" section that I detail my problem there.
    30.  
    31.  
    Errors on Reload:

    Code (Skript):
    1. ERROR HERE
    No errors.

    Code (Skript):
    1. ERROR HERE
    Other Useful Info: Yes, I have /setrank command, When I change my rank it changes my prefix in chat, using the chat event. When I do /nick I also use the chat event.
    My problem is, When I type something in chat, it shows both my real IGN, and the nicked username at the same time.

    Addons using (including versions):
    ADDONS HERE

    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    You don't need a whole new post, next time just edit your first one^^;;;;
    But you only need one chat event. With two it's going to post two every time because you're telling it to, %player% is your ign, while {tullycore.nickname.%player%} is the nickname you set. you are telling it to broadcast both instances of this with two chat events.
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    So, how do I make it so both aren't showing together?
    If I'm disabling the setrank chatevent for example it won't work for me,
    Sorry if i'm being a noob haha, I'm kind of new ;c
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Perhaps something like this? You really only need it to just choose between them so its not spewing everything at you~
    Code (Skript):
    1. on chat:
    2.     if {nicked-check} is true:
    3.         broadcast "&9%{tullycore.nickname.%player%}% &8» &f%message%"
    4.     else:
    5.         broadcast "%{tullycore.rank.%player%}%%player% &8» &f%message%"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...