#get players top score

1 messages · Page 1 of 1 (latest)

main jolt
#
const money = world.scoreboard.getObjective('money')
const scores = money.getScores()
const highToLow= scores.sort((a,b) => b.score - a.score)
const targetParticipant = highToLow[0].participant
const entity = targetParticipant.getEntity()
ivory linden
#

hi sorry but I have a little problem with the display

brittle nimbus
#

What are you trying to display?

#

As can you see, highToLow is an array with Objects, not a string

main jolt
ivory linden
# main jolt Send ur code
            const vote = world.scoreboard.getObjective('votenumber')
            const scores = vote.getScores()
            const highToLow = scores.sort((a,b) => b.score - a.score)
            const targetParticipant = highToLow[0].participant
            const entity = targetParticipant.getEntity()
            world.sendMessage(`§e${entity.name} [Here Score] §aVien De Gagner Le Vote`)
main jolt
#

Uhm, if ur using player to setScore, then when they're offline, the displayName won't be like their .name

ivory linden
#

ok

#

th man