Skript doesn't tell apart offline players' name

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

Fladsaw

Member
Jul 18, 2022
31
0
6
21
Hey everyone! I am pretty sure that this is a Skript bug and it's driving me crazy. So basically, when I write a skript like the one below, even if I write a non-existent name in the command, it doesn't tell them apart it. No errors either. It just goes "This player's name is fegfkfnfbd". How can I fix this?

Code:
command /test <offlineplayer>:
    trigger:
        if arg 1 is set:
            if arg 1 is a offline player:
                send "This player's name is %arg-1% !"
 
Hey everyone! I am pretty sure that this is a Skript bug and it's driving me crazy. So basically, when I write a skript like the one below, even if I write a non-existent name in the command, it doesn't tell them apart it. No errors either. It just goes "This player's name is fegfkfnfbd". How can I fix this?

Code:
command /test <offlineplayer>:
    trigger:
        if arg 1 is set:
            if arg 1 is a offline player:
                send "This player's name is %arg-1% !"
My first question is why are you checking if arg-1 is an offline player when you already have it set to 'offlineplayer'? Anyway, a way to do this is:

Code:
loop all players:
    if arg-1 contains loop-player:
        send "This player is an online player!"
    else:
        send "This player is not an online player!
    exit loop

Also, why are you not expecting any errors even though you ask it to identify an OFFLINE player? don't you only want an online one?
 
My first question is why are you checking if arg-1 is an offline player when you already have it set to 'offlineplayer'? Anyway, a way to do this is:

Code:
loop all players:
    if arg-1 contains loop-player:
        send "This player is an online player!"
    else:
        send "This player is not an online player!
    exit loop

Also, why are you not expecting any errors even though you ask it to identify an OFFLINE player? don't you only want an online one?

It seems that, for an unknown reason, the Skript is interpreting the "<offlineplayer>" argument as both online and offline players. This is exactly what I want to achieve. My issue, however, is that the command still works when I input a non-existent Minecraft account name. But your suggestion doesn't solve this problem.
 
Last edited:
It seems that, for an unknown reason, the Skript is interpreting the "<offlineplayer>" argument as both online and offline players. This is exactly what I want to achieve. My issue, however, is that the command still works when I input a non-existent Minecraft account name. But your suggestion doesn't solve this problem.
Then I don't get your problem, aka this isn't possible.
 
Then I don't get your problem, aka this isn't possible.

Yeah as I previously said this is probably a Skript bug. But I believe there is a solution to this. If you don't get it, you can just take my code and type "/test jgkdfjbnfjgh" in game. Skript will send the message although this is a non-existent Minecraft account.
 
Yeah as I previously said this is probably a Skript bug. But I believe there is a solution to this. If you don't get it, you can just take my code and type "/test jgkdfjbnfjgh" in game. Skript will send the message although this is a non-existent Minecraft account.
Yes, because Skript sees an offline player as any player, even one whose account doesn't exist yet; meaning it can't distinguish an offline player from a non-existent one.
 
Anyone else? I really need this to work.
If you can make an HTTP GET request with Skript, use the Mojang API to check whether an account with a certain name exists.
wiki: https://wiki.vg/Mojang_API#Username_to_UUID
example:
1. https://api.mojang.com/users/profiles/minecraft/namehere returns the UUID of the account that has the name "NameHere". (the API is caps-insensitive)
2. https://api.mojang.com/users/profiles/minecraft/thisnamedoesnotexist returns an error, describing that an account with that name doesn't exist.

(I'm not experienced in using Skript, but a quick search tells me you could use something like Reqn)
 
I don't know why nobody's given you a straight answer here. Just check if the player *isn't* in the list of all players (all players returns all currently online players).