Solved Nickname

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

TullyMastully

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

code_language.skript:
on chat:
    if {Name.%UUID of player%} is {Name.%UUID of player%}:
        broadcast "&9%{Name.%UUID of player%}% &8» &f%message%"
    else:
        #This one is for my ranking system
        broadcast "%{tullycore.rank.%player%}%%player% &8» &f%message%"

#Nick command
command /nick [<text>]:
    permission: tullycore.nick
    permission message: &a&lTULLYCORE &cYou can't execute this command, You need to be the VIP rank or higher!
    trigger:
        if arg is not set:
            send "{@secprefix} &cIncorrect usage, Try /nick (Username)"
        if arg 1 is "iJoin":
            send "{@secprefix} &cCan't nick yourself as iJoin."
        if arg 1 is "off":
            set player tab name to "%{tullycore.rank.%player%}%%player%"
            set player's display name to "%{tullycore.rank.%player%}%%player%"
            message "{@secprefix} &aYou are no longer nicked!"
            clear {Name.%UUID of player%}
        if arg 1 is not "off":
            set player's display name to "&9%arg 1%"
            set player tab name to "&9%arg 1%"
            send "{@secprefix} &aYou are now nicked as %arg 1%!" to player
            set {Name.%UUID of player%} to arg 1
           

   
on join:
    set player tab name to {Name.%UUID of player%}
    set player's display name to {Name.%UUID of player%}
 

Attachments

  • Screenshot_2.png
    Screenshot_2.png
    22.4 KB · Views: 242
Hey, I've been making a skript command, although when I nick myself, this happens (See Picture)
It shows twice the nicked username.

code_language.skript:
on chat:
    if {Name.%UUID of player%} is {Name.%UUID of player%}:
        broadcast "&9%{Name.%UUID of player%}% &8» &f%message%"
    else:
        #This one is for my ranking system
        broadcast "%{tullycore.rank.%player%}%%player% &8» &f%message%"

#Nick command
command /nick [<text>]:
    permission: tullycore.nick
    permission message: &a&lTULLYCORE &cYou can't execute this command, You need to be the VIP rank or higher!
    trigger:
        if arg is not set:
            send "{@secprefix} &cIncorrect usage, Try /nick (Username)"
        if arg 1 is "iJoin":
            send "{@secprefix} &cCan't nick yourself as iJoin."
        if arg 1 is "off":
            set player tab name to "%{tullycore.rank.%player%}%%player%"
            set player's display name to "%{tullycore.rank.%player%}%%player%"
            message "{@secprefix} &aYou are no longer nicked!"
            clear {Name.%UUID of player%}
        if arg 1 is not "off":
            set player's display name to "&9%arg 1%"
            set player tab name to "&9%arg 1%"
            send "{@secprefix} &aYou are now nicked as %arg 1%!" to player
            set {Name.%UUID of player%} to arg 1
       

 
on join:
    set player tab name to {Name.%UUID of player%}
    set player's display name to {Name.%UUID of player%}
You need to cancel the chat event then broadcast the message
code_language.skript:
on chat:
    if {Name.%UUID of player%} is {Name.%UUID of player%}:
        cancel event
        broadcast "&9%{Name.%UUID of player%}% &8» &f%message%"
    else:
        #This one is for my ranking system
        cancel event
        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
 
You need to cancel the chat event then broadcast the message
code_language.skript:
on chat:
    if {Name.%UUID of player%} is {Name.%UUID of player%}:
        cancel event
        broadcast "&9%{Name.%UUID of player%}% &8» &f%message%"
    else:
        #This one is for my ranking system
        cancel event
        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
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!
 
Status
Not open for further replies.