player's uuid

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

iStopcontact

Member
Feb 18, 2017
113
2
18
23
Heey guys I am working on my own rank skript for my server network

Now its all done and i have all the variables with "player's uuid" in it for example:
code_language.skript:
if {sn:rank:%player's uuid%} is not set:

And i thought if i use that, it will write down the uuid and when player changes his name it will still work because the UUID wil always be the same.
But when a player changes his name the rank he has wont come with him but just joines as a member.
Now i saw somewhere that there also is a think like "
code_language.skript:
%UUID of player%
"
But i dont know if that works

Can someone tell me what goes wrong or what will work so players can just change there name and the rank will be the same
 
First, save the player's uuid if it's not set:
code_language.skript:
on connect:
    if {uuid::%player%} is not set:
        set {uuid::%player%} to player's uuid
Then, you will be able to use the variable:
code_language.skript:
{sn:rank:%{uuid::%player%}%}
{sn:rank:%{uuid::%arg 1%}%}
{sn:rank:%{uuid::%loop-value%}%}
...
 
First, save the player's uuid if it's not set:
code_language.skript:
on connect:
    if {uuid::%player%} is not set:
        set {uuid::%player%} to player's uuid
Then, you will be able to use the variable:
code_language.skript:
{sn:rank:%{uuid::%player%}%}
{sn:rank:%{uuid::%arg 1%}%}
{sn:rank:%{uuid::%loop-value%}%}
...
Sorry for the late reply, i tried it but unfortunately it didnt work

A friend of my changed his name for it to test it, but it didnt work
 
What code did you use?
Are you on a bungeecord network?
Is your server cracked?
Yes I am on a bungeenetwork, so yes the server is in offline mode because it must be for bungeecord

This was my code what i used to test it:
code_language.skript:
on connect:
    if {uuid::%player%} is not set:
        set {uuid::%player%} to player's uuid

command /test:
    trigger:
        set {snhub:test:%{uuid::%player%}%} to true

command /testt:
    trigger:
        message "%{uuid::%player%}%"

on chat:
    cancel event
    if {snhub:test:%{uuid::%player%}%} is true:
        broadcast "&f&lTest &d%player% &9- &7%message%"
    else:
        broadcast "&e%player% &a%message%"
 
Yes I am on a bungeenetwork, so yes the server is in offline mode because it must be for bungeecord

This was my code what i used to test it:

code_language.skript:
on connect:
    if {uuid::%UUID of player%} is not set:
        set {uuid::%UUID of player%} to player's uuid

command /test:
    trigger:
        set {snhub:test:%{uuid::%UUID of player%}%} to true

command /testt:
    trigger:
        message "%{uuid::%player%}%"

on chat:
    cancel event
    if {snhub:test:%{uuid::%UUID of player%}%} is true:
        broadcast "&f&lTest &d%player% &9- &7%message%"
    else:
        broadcast "&e%player% &a%message%"
Did you set the bungeecord setting in your spigot.yml file to true?
This one:
esnVKPRfQ7_Chnwl-i1Osg.png
 
Uhmm no I didnt do that, i saw that but i was not sure what it was suposed to do so no i didnt change that
But what does that when i change it to true?
If your using bungeecord and you set it to true it will use online-uuids and when using online-uuids players will keep there stuff / ranks if they change there name cuz those online-uuids are based on some ones mojang / minecraft account not just the username.
But if you keep it set to false it will use offline-uuids which are just based on a username and this uuid will just change every time some one changes his name.

If you've had players join before when you had bungeecord set to false those players will join the server as a new players and will loose everything. (But maybe your lucky and there is some other way around)
 
Last edited by a moderator:
If your using bungeecord and you set it to true it will use online-uuids and when using online-uuids players will keep there stuff / ranks if they change there name cuz those online-uuids are based on some ones mojang / minecraft account not just the username.
But if you keep it set to false it will use offline-uuids which are just based on a username and this uuid will just change every time some one changes his name.

If you've had players join before when you had bungeecord set to false those players will join the server as a new players and will loose everything. (But maybe your lucky and there is some other way around)
Lucky for me now the servers isnt open yet, my network will open in 1 1/2 week so i will try that out later on the day because now i need to fine someone else who wants to change his name for this haha to try it out
[doublepost=1500978730,1500978616][/doublepost]
First, save the player's uuid if it's not set:
code_language.skript:
on connect:
    if {uuid::%player%} is not set:
        set {uuid::%player%} to player's uuid
Then, you will be able to use the variable:
code_language.skript:
{sn:rank:%{uuid::%player%}%}
{sn:rank:%{uuid::%arg 1%}%}
{sn:rank:%{uuid::%loop-value%}%}
...

But do i still need to use that one @sandor_1234 or can I also just use for example:
code_language.skript:
{sn:rank:%player's uuid%}
or
code_language.skript:
sn:rank:%UUID of player%}
 
Lucky for me now the servers isnt open yet, my network will open in 1 1/2 week so i will try that out later on the day because now i need to fine someone else who wants to change his name for this haha to try it out
[doublepost=1500978730,1500978616][/doublepost]

But do i still need to use that one @sandor_1234 or can I also just use for example:
code_language.skript:
{sn:rank:%player's uuid%}
or
code_language.skript:
sn:rank:%UUID of player%}
Yeah you could just use:
code_language.skript:
{sn::rank::%UUID of player%}
 
Status
Not open for further replies.