Jump to content

Username of owner of number variable


WesGamer

Recommended Posts

Hello, my goal with this is to create a leaderboard. i know there is a leaderboard skript but that is too complicated and long. I want to know how (if possible) to retrieve the username of a owner.

for example i have the variable {bal::%uuid of player%} it is an balance of a player. so its a number. how do i get the username of the owner of the balance? Thank you! for helping

I do not have any code so far

I'm not allowed to have discord cause of my parents so i can not get contact in discord it would be nice if it was just in this forum topic chat.

Link to comment
Share on other sites

10 hours ago, WesGamer said:

Yes thx this is very helpfull! Anyway to convert uuid to username?

You get get a player from a uuid using this, be mindful that it requires the skript addon 'TuSke'.

  • Thanks 1

Support  July 29, 2020 → November 3, 2020

► Helper November 3, 2020 → February 22, 2021

► Moderator February 22, 2021 → May 17, 2021

 I might not always respond to forum dms, however I am always contactable on discord (mig#0069)

Screen Shot 2020-03-20 at 5.23.33 pm.png

Link to comment
Share on other sites

I found the example but now i have a problem with the code

command /baltop:
  trigger:
    set {dupebal::*} to {bal::*}
    loop 3 times:
      loop {dupebal::*}:
        if {highest} is not set:
          set {highest} to loop-value-2
          set {hname} to loop-index
        if {highest} is set:
          if loop-value-2 > {highest} :
            set {highest} to loop-value-2
            set {hname} to loop-index
        remove ... from {dupebal::*}
      set {high.name} to offline player from "%{hname}%"
      send "&b%loop-number%&7. %{high.name}% %{highest}%" 

how do i remove the highest outcome of the dupebal loop from the {dupebal::*} list so i dont get duplicates

Link to comment
Share on other sites

You should use local variables first of all, and what do you mean duplicates? If it's done correctly, there shouldn't be a worry. And why go through it like this? Looping through that list 3 times without any sort of pausing will create a bunch of lag when you have more values within the list.

Zora

💬 » Discord: @reportcards

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...