Solved Skript Loops UUID instead of playername.

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

iMinePixels

Member
Mar 12, 2024
18
0
1
22
I need some help with this. %loop-value% list a uuid instead of a player's name. Is there a way I can fix this?

Code:
        if arg-1 is "list":
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&4ᴄᴜʀʀᴇɴᴛ ꜱᴜꜱᴘᴇᴄᴛ ʟɪꜱᴛ:"
                    loop {suspectList::*}:
                        send "&8- &b%loop-index%&8: &c%loop-value%"

Would appreciate the help. <3
Edit: I think i know why:
I had "use player UUIDs in variable names: false" true in the config. I had to set it to true for another skript I had...
How do I prevent the "In the future, players in variable names will use the player's UUID instead of their name." message without setting that setting to true? Have a list of uuids isn't helpful, I need to see the player name without causing spam every time skript loads my skript.

Using %arg-2% - with the "use player UUIDs in variable names:" set to false, displays correctly, but spams my console/chat when the skript is loaded/reloaded.:
1713643846217.png

Using %uuid of arg-2% displays this - but doesn't send those "In the future," messages.

1713642253099.png
 
Last edited:
Still needing help.
(Video Clip not a download)

One way gets rid of the warnings, but displays the UUID, the other displays the player names but causes the warnings.
 
Last edited:
Code:
        if arg-1 is "list":
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&4ᴄᴜʀʀᴇɴᴛ ꜱᴜꜱᴘᴇᴄᴛ ʟɪꜱᴛ:"
                    loop {suspectList::*}:
                        send "&e✏ &b%loop-index%&8: &c%name of loop-value%"

I exchanged out %arg-2% with %uuid of arg-2% and changed out %loop-value% with %name of loop-value%. When I use "/suspect add iMinePixels Test", it now still shows the uuid but my reason provided is broken.
1714406236873.png
 
What is {suspectList::*} set to? also why are you using %loop-index%? Use %loop-value%. iirc indexes of a list variable is just whatever is after the ::, which is gonna be a uuid if that's how your variable is setup (I may be wrong about this I forgot).
 
What is {suspectList::*} set to? also why are you using %loop-index%? Use %loop-value%. iirc indexes of a list variable is just whatever is after the ::, which is gonna be a uuid if that's how your variable is setup (I may be wrong about this I forgot).
I am using %loop-index% because some supporter of there discord wrote it to me.

I have this for your first question.

Code:
                if arg-3 is set:
                    if {suspectList::*} does not contain {suspectList::%arg-2%}:
                        message "&8[&c&l•&8] &4&lꜱᴛᴀꜰꜰ &8→ &fYou have added &4%{_suspect}%&f to the watchlist."
                        set {suspectList::%arg-2%} to arg-3

I just need to literally list <player>: <reason> for the command "/suspect add iMinePixels Test". The loop-index is the thing that worked so far, but idk what to do for it to not display the uuid. If I use just loop-value, only the reason (arg-3) is displayed, which doesn't state who it's for.
 
Last edited:
Code:
        if arg-1 is "list":
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&4ᴄᴜʀʀᴇɴᴛ ꜱᴜꜱᴘᴇᴄᴛ ʟɪꜱᴛ:"
                    loop {suspectList::*}:
                        send "&e✏ &b%loop-index%&8: &c%loop-value%"

I exchanged out %arg-2% with %uuid of arg-2% and changed out %loop-value% with %name of loop-value%. When I use "/suspect add iMinePixels Test", it now still shows the uuid but my reason provided is broken.
View attachment 8575
I don't fully understand your skript and how it can retrieve the uuid from loop-index but im pretty sure you can just do name of player with uuid "UUID HERE"
Edit:
I looked at NixTer's reasoning and I think I understand now
here should be the working stuff

code_language.skript:
        if arg-1 is "list":
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&4ᴄᴜʀʀᴇɴᴛ ꜱᴜꜱᴘᴇᴄᴛ ʟɪꜱᴛ:"
                    loop {suspectList::*}:
                        send "&e✏ &b%name of player with uuid loop-index%&8: &c%loop-value%"
 
I don't fully understand your skript and how it can retrieve the uuid from loop-index but im pretty sure you can just do name of player with uuid "UUID HERE"
Edit:
I looked at NixTer's reasoning and I think I understand now
here should be the working stuff

code_language.skript:
        if arg-1 is "list":
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&4ᴄᴜʀʀᴇɴᴛ ꜱᴜꜱᴘᴇᴄᴛ ʟɪꜱᴛ:"
                    loop {suspectList::*}:
                        send "&e✏ &b%name of player with uuid loop-index%&8: &c%loop-value%"
1714456543390.png

For better understanding, what else can I provide? I'm trying not to post the full skript cause I don't want to be judged lol.
 
to fix it overall you can just store it as a name
so use this:

Code:
if arg-1 is "list":
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&4ᴄᴜʀʀᴇɴᴛ ꜱᴜꜱᴘᴇᴄᴛ ʟɪꜱᴛ:"
                    loop {suspectList::*}:
                        send "&8- &b%loop-index%&8: &c%loop-value%"

and change the other thing to this:

Code:
                if arg-3 is set:
                    if {suspectList::*} does not contain {suspectList::%arg-2%}:
                        message "&8[&c&l•&8] &4&lꜱᴛᴀꜰꜰ &8→ &fYou have added &4%{_suspect}%&f to the watchlist."
                        set {suspectList::%name of arg-2%} to arg-3
 
to fix it overall you can just store it as a name
so use this:

Code:
if arg-1 is "list":
            if arg-2 is not set:
                if arg-3 is not set:
                    message "&4ᴄᴜʀʀᴇɴᴛ ꜱᴜꜱᴘᴇᴄᴛ ʟɪꜱᴛ:"
                    loop {suspectList::*}:
                        send "&8- &b%loop-index%&8: &c%loop-value%"

and change the other thing to this:

Code:
                if arg-3 is set:
                    if {suspectList::*} does not contain {suspectList::%arg-2%}:
                        message "&8[&c&l•&8] &4&lꜱᴛᴀꜰꜰ &8→ &fYou have added &4%{_suspect}%&f to the watchlist."
                        set {suspectList::%name of arg-2%} to arg-3
This totally worked. That's weird that "%name of arg-2%" works without telling me about the future uuid change, but %arg-2% to return the input username does. Thank you!
 
This totally worked. That's weird that "%name of arg-2%" works without telling me about the future uuid change, but %arg-2% to return the input username does. Thank you!
The reason it doesn't alert you is because arg-2 contains all the data of the player, so when we call %name of arg-2% it directly returns the name not all the information. We are clarifying to skript that we want to store his name not the uuid. When we just provide arg-2 is guesses to store the uuid instead so we clarify.
 
  • Like
Reactions: iMinePixels
The reason it doesn't alert you is because arg-2 contains all the data of the player, so when we call %name of arg-2% it directly returns the name not all the information. We are clarifying to skript that we want to store his name not the uuid. When we just provide arg-2 is guesses to store the uuid instead so we clarify.
Thank you so much for explaining. I appreciate it!