➨ Guide on making the leaderboard hologram 👾

Joined
May 29, 2023
Messages
41
there are a few methods to making the leaderboard hologram
long story short you make an array or maybe 2 one containing scores and one containing the names fill it with empty data
then when the player gains a point or money or something you loop through the array checking if his name already exists in the array containing the names if not skip to the next part, if it does get the index of that name push up the data starting from the index we have selected until the last position of the array for example our player is at the position #2 we take the data from #3 and put it into #2, then #4 -> #3, #5 -> #4 and so on long story short this part removes the player's data from the leaderboard while keeping all of the other data in order now you might be asking why not just push down the data that is above the player's old position and replace the data at the new position with the players data well u can do this if the player score can only increase but decrease if the player's score were to decrease the player would have a lower position and you would find that the at player's old position the data is not being overwritten. for the next part we loop through the array containing the scores and compare the player's score to the score in the array from top to bottom if it is more get the index of it i will name this indextoreplace next we push down the data starting from the bottom up until the indextoreplace like #4 -> #5, #3 -> #4 and so on lastly we replace the data at the indextoreplace position with the player's data

instead of using a loop or recursive function with array to check the score and name and to push the data u can instead use a ton of if variables and elses and set variables this will make your code exponentially longer but there is not delay! unless ofcourse you reach the java depth limit error and now u have to put the wait block

the following logic is demonstrated as follows:

we start with an array with empty data:
name score
1. null1 0
2. null2 0
3. null3 0
4. null4 0
5. null5 0

player1 earns a score
his score will replace the score at #1

push down the data

name score
1. null1 0
2. null1 0
3. null2 0
4. null3 0
5. null4 0

replace the data

name score
1. Player1 1
2. null1 0
3. null2 0
4. null3 0
5. null4 0

player2 earns a score
his score will replace #2

push down the data

name score
1. Player1 1
2. null1 0
3. null1 0
4. null2 0
5. null3 0

replace the data

name score
1. Player1 1
2. Player2 1
3. null1 0
4. null2 0
5. null3 0

player 2 earns another score

push up the data

name score
1. Player1 1
2. null1 0
3. null2 0
4. null3 0
5. null4 0

push down the data

name score
1. Player1 1
2. Player1 1
3. null1 0
4. null2 0
5. null3 0

replace the data

name score
1. Player2 2
2. Player1 1
3. null1 0
4. null2 0
5. null3 0

player 2 point loses 1 point

push up the data

name score
1. Player1 1
2. null1 0
3. null2 0
4. null3 0
5. null4 0

push down the data

1. Player1 1
2. null1 0
3. null1 0
4. null2 0
5. null3 0

replace

1. Player1 1
2. Player2 1
3. null1 0
4. null2 0
5. null3 0

congratulashins you have created a fool proof leaderboard hologram even a fool can code it and when i mean fool i dont mean aalus

msg proximus0 if u have easier way
 

mugheera1122

Member
Joined
May 21, 2023
Messages
85
can you plea
there are a few methods to making the leaderboard hologram
long story short you make an array or maybe 2 one containing scores and one containing the names fill it with empty data
then when the player gains a point or money or something you loop through the array checking if his name already exists in the array containing the names if not skip to the next part, if it does get the index of that name push up the data starting from the index we have selected until the last position of the array for example our player is at the position #2 we take the data from #3 and put it into #2, then #4 -> #3, #5 -> #4 and so on long story short this part removes the player's data from the leaderboard while keeping all of the other data in order now you might be asking why not just push down the data that is above the player's old position and replace the data at the new position with the players data well u can do this if the player score can only increase but decrease if the player's score were to decrease the player would have a lower position and you would find that the at player's old position the data is not being overwritten. for the next part we loop through the array containing the scores and compare the player's score to the score in the array from top to bottom if it is more get the index of it i will name this indextoreplace next we push down the data starting from the bottom up until the indextoreplace like #4 -> #5, #3 -> #4 and so on lastly we replace the data at the indextoreplace position with the player's data

instead of using a loop or recursive function with array to check the score and name and to push the data u can instead use a ton of if variables and elses and set variables this will make your code exponentially longer but there is not delay! unless ofcourse you reach the java depth limit error and now u have to put the wait block

the following logic is demonstrated as follows:

we start with an array with empty data:
name score
1. null1 0
2. null2 0
3. null3 0
4. null4 0
5. null5 0

player1 earns a score
his score will replace the score at #1

push down the data

name score
1. null1 0
2. null1 0
3. null2 0
4. null3 0
5. null4 0

replace the data

name score
1. Player1 1
2. null1 0
3. null2 0
4. null3 0
5. null4 0

player2 earns a score
his score will replace #2

push down the data

name score
1. Player1 1
2. null1 0
3. null1 0
4. null2 0
5. null3 0

replace the data

name score
1. Player1 1
2. Player2 1
3. null1 0
4. null2 0
5. null3 0

player 2 earns another score

push up the data

name score
1. Player1 1
2. null1 0
3. null2 0
4. null3 0
5. null4 0

push down the data

name score
1. Player1 1
2. Player1 1
3. null1 0
4. null2 0
5. null3 0

replace the data

name score
1. Player2 2
2. Player1 1
3. null1 0
4. null2 0
5. null3 0

player 2 point loses 1 point

push up the data

name score
1. Player1 1
2. null1 0
3. null2 0
4. null3 0
5. null4 0

push down the data

1. Player1 1
2. null1 0
3. null1 0
4. null2 0
5. null3 0

replace

1. Player1 1
2. Player2 1
3. null1 0
4. null2 0
5. null3 0

congratulashins you have created a fool proof leaderboard hologram even a fool can code it and when i mean fool i dont mean aalus

msg proximus0 if u have easier way
can you please make it in my game
 

mugheera1122

Member
Joined
May 21, 2023
Messages
85
Your game is pvp parkour! what for u need top hologram!
WOW, I'M GLAD TO KNOW THAT YOU KNOW MY GAME!
by the way now i destroyed pvp parkour u can go check /ad minegrind (idk why i do this and now i am missing my first game to reach 1k means my pvp parkour) and now i am making a new pvp with different gamemodes game which is 1 time greifed so i need trusted coder like you


now dont say me like how i am trusted or something ik you and you are a good guy...

please say yes...
i invited you to be my coder


only some time in a day like 20-30 mins
 

mugheera1122

Member
Joined
May 21, 2023
Messages
85
hey mugheera1122 your a pvp parkour coder? can u teach me how to pls im tryna get like the most profitable gamemode outta these thing called var and array i had abs no idea how to
sure sure i can code for you!!
 

ItchyDitchy

Member
Joined
Jun 30, 2023
Messages
61
I found a better way, if you could uh, go online on discord and msg me on dev-chat at global discord mineland.
 

ItchyDitchy

Member
Joined
Jun 30, 2023
Messages
61
it would've been very easy if arrays worked the way they should be
1689163755945.png


via arrays
1 function for adding a player (1line)
1 function for preparing values(1line, on world start)
1 function for hologram(1line, 8< blocks for the line)
 
Top