Solved Get player through their 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 community!

    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.

PatoFrango

Active Member
Jul 12, 2017
240
14
18
Hi,

I know it's possible to get a UUID of a player through the player itself, but is it possible to get a player through a UUID?
 
yeah

set {_player} to {variable-containing-uuid} parsed as player
 
i just tested it, and it works totally fine... how are you inputing the UUID?
[doublepost=1530001205,1530001159][/doublepost]i just tried this.... entering a UUID into the txt spot of the command, and it returns the player

code_language.skript:
command /test <text>:
    trigger:
        set {_player} to arg-1 parsed as player
        send "%{_player}%"
[doublepost=1530001436][/doublepost]EDIT:
I believe the UUID you are using, has to be of a player that has logged onto your server at some point.
I tried my UUID and it works, tried a player that has never been on my server and it returns <none>
 
i just tested it, and it works totally fine... how are you inputing the UUID?
[doublepost=1530001205,1530001159][/doublepost]i just tried this.... entering a UUID into the txt spot of the command, and it returns the player

code_language.skript:
command /test <text>:
    trigger:
        set {_player} to arg-1 parsed as player
        send "%{_player}%"
I'm inputing it through a loop.

code_language.skript:
function updateTempBan():
    loop {bans::*}:
        set {_elapsed} to difference between now and {tempBan.BanExpire.%loop-value%}
        set {_player} to {bans::%loop-index%} parsed as player
        if {_elapsed} is more than {tempBan.BanLength.%loop-value%}:
            unban {_player}
I have a void function looping through an array. The {bans::%loop-index%} represents the UUID registered in that array, and I was trying to parse the UUID as a player. Should be possible, right?

Edit: And yes, I'm trying to use my own UUID to do the trick so it should work.
 
i just tried it a few times, and based on my testing, the player has to be logged into the server to use their UUID
 
i just tried it a few times, and based on my testing, the player has to be logged into the server to use their UUID
Ah, I see. What sort of mechanism could I do then to associate the UUID with its user? Skript doesn't have multi-dimensional arrays, does it? I was thinking on doing something like each time a player joins the server it associates their UUID with their current player name in case they changed it, and then if the player gets banned... nah, that won't work, the player could change its name while banned, so they wouldn't be able to connect therefore the new name wouldn't get registered to the new UUID. Dang it.
Any ideas?
 
If you use this, you have to parse it as an offline player and not as a player. You can also use this.
Ah, thanks very much, parsing as an offlineplayer did the job and I'm sure using SkQuery would too, but in this particular case I was looking for a solution with the least amount of addons possible, so this is just what I wanted.
 
o
If you use this, you have to parse it as an offline player and not as a player. You can also use this.
oh right DUH.... man sometimes the easiest things are right there in front of your face and they just don't come to ya
 
Status
Not open for further replies.