BedWars Creative
  • 📜Changelog
  • ðŸŽĻSandbox Mode
  • 🊓WorldEdit Commands
  • ðŸ›ĄïļWorldGuard System
  • 🍊BedWars Scripting
    • 🚜Services
      • ðŸŽ―AbilityService
      • ðŸ“ĢAnnouncementService
      • ðŸ§ąBlockService
      • ðŸ”ĪChatService
      • ⚔ïļCombatService
      • 🌊ïļDisasterService
      • 🊅DataStoreService
      • ðŸŠĻEntityService
      • ðŸ”ĨForgeService
      • 🏭GeneratorService
      • ðŸ‘Đ‍🚀GravityService
      • âŒĻïļInputService
      • 🎒InventoryService
      • 💎ItemService
      • 🛏ïļMatchService
      • â„đïļMessageService
      • 🎁ModelService
      • ðŸĶĪMountService
      • 🏄‍♂ïļPlayerService
      • 🏗ïļPartService
      • 🎉ParticleService
      • 👆PromptService
      • 💰ShopService
      • ðŸ“ŧSoundService
      • 🊄StatusEffectService
      • 🚁VehicleService
      • ðŸšĐTeamService
      • ðŸĨ‡UIService
    • ðŸĪEvents
      • BeforeProjectileLaunched
      • BlockPlace
      • BlockBreak
      • BedAlarmTriggered
      • ConsumeItem
      • Enchant
      • EntityDamage
      • EntityDeath
      • EntitySpawn
      • Forged
      • InventoryItemAdded
      • ItemPurchase
      • MatchStart
      • PlayerChatted
      • PlayerAdded
      • PlayerRemoving
      • PlayerDropItem
      • PlayerPickupItem
      • ProjectileLaunched
      • ProjectileHit
      • StatusEffectAdded
      • StatusEffectRemoved
      • WeaponSwing
      • TeamUpgradePurchased
      • TeamUpgradeEraPurchased
      • Telepearled
      • UseAbility
    • ðŸ“ĶObjects
      • AbilityConfig
      • Block
      • Entity
        • ImageEntity
        • KitEntity
        • CreatureEntity
      • Generator
      • Knockback
      • Leaderboard
      • MatchState
      • Model
      • ParticleEmitter
      • Part
      • Player
      • Prompt
      • ProgressBar
      • TextLabel
      • Team
    • 📚Types
      • AbilityType
      • AbilityInputType
      • CreatureType
      • DisasterType
      • EnchantType
      • ItemType
      • KitType
      • ModelType
      • MountType
      • VehicleType
      • ProjectileType
      • SoundType
      • StatusEffectType
      • TeamUpgradeEraType
      • TeamUpgradeType
      • MatchRole
    • ⚙ïļUtilities
      • require
      • math
      • pairs & ipairs
      • print & error
      • os
      • string
      • table
      • task
      • tick
      • tostring & tonumber
      • wait
Powered by GitBook
On this page
  1. BedWars Scripting
  2. Objects

Leaderboard

A leaderboard shown on a player's HUD.

PreviousKnockbackNextMatchState

Last updated 1 year ago

For examples on how to use, refer to .

A leaderboard consists of entries (the rows displayed on the UI). Each entry has a key and a score associated with it.

  • Keys refer to the names of what is being ranked on the leaderboard. You can add Players, Teams, or words (strings) to the leaderboard.

  • Scores are the number displayed next to each key. The leaderboard entries are automatically ordered by descending scores. The rank of a key is its place.

Functions

getKeys(): Array< | | string>

Returns the keys of the leaderboard.

addKey(key: | | string, initialScore: number | nil)

Adds a new key to the leaderboard of the given type. You can optionally give the key an initial score, which otherwise defaults to zero.

removeKey(key: | | string)

Removes the key from the leaderboard.

addScore(key: | | string, amount: number)

Adds the given amount to the current score of the key.

subScore(key: | | string, amount: number)

Subtracts the given amount from the current score of the key.

Sets the score of the key to the given amount.

Returns the current score of the key. Returns nil if the key is not part of the leaderboard.

Returns the key located at the place. Returns nil if there is no key at the place.

clear()

Clears all leaderboard entries.

setScore(key: | | string, amount: number)

getScore(key: | | string): number | nil

getPlace(place: number): | | string | nil

🍊
ðŸ“Ķ
UIService
Player
Team
Player
Team
Player
Team
Player
Team
Player
Team
Player
Team
Player
Team
Player
Team