#get players top score
1 messages · Page 1 of 1 (latest)
hi sorry but I have a little problem with the display
What are you trying to display?
As can you see, highToLow is an array with Objects, not a string
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`)
Uhm, if ur using player to setScore, then when they're offline, the displayName won't be like their .name