- Supported Skript Version
- 2.12
- 2.13
- 2.14
- 2.15
- Supported Minecraft Versions
- 1.21
- 26.1
Requirements : Skript, CommandPanels, Vault
About the Script:
This script may look simple, but it gets the job done.I designed it specifically for Aternos server users, so it works smoothly even on small or limited servers.
Features:
- A beautifully designed interface.
- Dialog support in the search system.
- A filtering system with 6 different filters.
- Sound effects that add a pleasant and polished touch
- Aternos support
Installation:
To make the script work, follow these steps:
1- Place the main code inside: Skript/scripts
2- Then place the second code inside: CommandPanels/panels
Compatibility:
The script supports both Java and Bedrock players.
️️Note:
The script is not highly customizable, but I’m still a beginner and improving over time.
If you have any feedback or suggestions, I’d love to hear them so I can make it even better
About the Script:
This script may look simple, but it gets the job done.I designed it specifically for Aternos server users, so it works smoothly even on small or limited servers.
- A beautifully designed interface.
- Dialog support in the search system.
- A filtering system with 6 different filters.
- Sound effects that add a pleasant and polished touch
- Aternos support
Installation:
To make the script work, follow these steps:
1- Place the main code inside: Skript/scripts
2- Then place the second code inside: CommandPanels/panels
Compatibility:
The script supports both Java and Bedrock players.
️️Note:
The script is not highly customizable, but I’m still a beginner and improving over time.
If you have any feedback or suggestions, I’d love to hear them so I can make it even better
Code:
#Made by Kouro
#Main Code >>>>>>>>
command /baltop [<text>] [<text>]:
description: View the top balances of all players.
executable by: players
trigger:
if arg-1 is "search":
if arg-2 is set:
clear {result::%uuid of player%::*}
clear {order::%uuid of player%::*}
clear {search::%uuid of player%::*}
loop all offline players:
add uuid of loop-value to {result::%uuid of player%::*}
set {order::%uuid of player%::%uuid of loop-value%::val} to loop-value's balance
set {order::%uuid of player%::%uuid of loop-value%::str} to loop-value
set {search::%uuid of player%::result} to arg-2
CreatePage(player, "&6Search", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, 1, false, {sortMode::%uuid of player%})
stop
clear {result::%uuid of player%::*}
clear {order::%uuid of player%::*}
clear {search::%uuid of player%::*}
set {sortMode::%uuid of player%} to "richest"
loop all offline players:
add uuid of loop-value to {result::%uuid of player%::*}
set {order::%uuid of player%::%uuid of loop-value%::val} to loop-value's balance
set {order::%uuid of player%::%uuid of loop-value%::str} to loop-value
CreatePage(player, "&aᴛᴏᴘ ʙᴀʟ", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, 1, true, {sortMode::%uuid of player%})
on inventory click:
if name of event-inventory contains "&aᴛᴏᴘ ʙᴀʟ - ᴘᴀɢᴇ ":
cancel event
set {_page} to name of event-inventory parsed as "&aᴛᴏᴘ ʙᴀʟ - ᴘᴀɢᴇ %integer%"
if custom model data of event-slot is 100002:
add 1 to {_page}
CreatePage(player, "&aᴛᴏᴘ ʙᴀʟ", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, {_page}, true, {sortMode::%uuid of player%})
play sound "minecraft:item.book.page_turn" with volume 1 to player
else if custom model data of event-slot is 100001:
remove 1 from {_page}
CreatePage(player, "&aᴛᴏᴘ ʙᴀʟ", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, {_page}, true, {sortMode::%uuid of player%})
play sound "minecraft:item.book.page_turn" with volume 1 to player
else if custom model data of event-slot is 100003:
close player's inventory
play sound "minecraft:block.dispenser.dispense" with volume 1 to player
execute console command "pa open search_baltop %player%"
else if custom model data of event-slot is 100000:
close player's inventory
clear {result::%uuid of player%::*}
clear {order::%uuid of player%::*}
clear {search::%uuid of player%::*}
loop all offline players:
add uuid of loop-value to {result::%uuid of player%::*}
set {order::%uuid of player%::%uuid of loop-value%::val} to loop-value's balance
set {order::%uuid of player%::%uuid of loop-value%::str} to loop-value
CreatePage(player, "&aᴛᴏᴘ ʙᴀʟ", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, {_page}, true, {sortMode::%uuid of player%})
play sound "minecraft:ui.cartography_table.take_result" with volume 1 to player
else if custom model data of event-slot is 100005:
set {_current} to {sortMode::%uuid of player%}
if {_current} is "richest":
set {sortMode::%uuid of player%} to "poorest"
else if {_current} is "poorest":
set {sortMode::%uuid of player%} to "richest-online"
else if {_current} is "richest-online":
set {sortMode::%uuid of player%} to "poorest-online"
else if {_current} is "poorest-online":
set {sortMode::%uuid of player%} to "richest-offline"
else if {_current} is "richest-offline":
set {sortMode::%uuid of player%} to "poorest-offline"
else:
set {sortMode::%uuid of player%} to "richest"
CreatePage(player, "&aᴛᴏᴘ ʙᴀʟ", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, {_page}, true, {sortMode::%uuid of player%})
play sound "minecraft:block.dispenser.dispense" with volume 1 to player
else if name of event-inventory contains "&6Search - ᴘᴀɢᴇ ":
cancel event
set {_page} to name of event-inventory parsed as "&6Search - ᴘᴀɢᴇ %integer%"
if custom model data of event-slot is 100002:
add 1 to {_page}
CreatePage(player, "&6Search", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, {_page}, false, {sortMode::%uuid of player%})
play sound "minecraft:item.book.page_turn" with volume 1 to player
else if custom model data of event-slot is 100001:
remove 1 from {_page}
CreatePage(player, "&6Search", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, {_page}, false, {sortMode::%uuid of player%})
play sound "minecraft:item.book.page_turn" with volume 1 to player
else if custom model data of event-slot is 100004:
execute player command "/baltop"
play sound "minecraft:block.dispenser.dispense" with volume 1 to player
else if custom model data of event-slot is 100000:
close player's inventory
clear {result::%uuid of player%::*}
clear {order::%uuid of player%::*}
loop all offline players:
if {search::%uuid of player%::result} is set:
if loop-value's name contains {search::%uuid of player%::result}:
add uuid of loop-value to {result::%uuid of player%::*}
set {order::%uuid of player%::%uuid of loop-value%::val} to loop-value's balance
set {order::%uuid of player%::%uuid of loop-value%::str} to loop-value
CreatePage(player, "&6Search", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, {_page}, false, {sortMode::%uuid of player%})
play sound "minecraft:ui.cartography_table.take_result" with volume 1 to player
else if custom model data of event-slot is 100005:
set {_current} to {sortMode::%uuid of player%}
if {_current} is "richest":
set {sortMode::%uuid of player%} to "poorest"
else if {_current} is "poorest":
set {sortMode::%uuid of player%} to "richest-online"
else if {_current} is "richest-online":
set {sortMode::%uuid of player%} to "poorest-online"
else if {_current} is "poorest-online":
set {sortMode::%uuid of player%} to "richest-offline"
else if {_current} is "richest-offline":
set {sortMode::%uuid of player%} to "poorest-offline"
else:
set {sortMode::%uuid of player%} to "richest"
CreatePage(player, "&6Search", "&7 ᴍᴏɴᴇʏ", {result::%uuid of player%::*}, {_page}, false, {sortMode::%uuid of player%})
play sound "minecraft:block.dispenser.dispense" with volume 1 to player
function CreatePage(p: player, title: string, valName: string, list: objects, page: number, searchBtn: boolean, sortMode: string):
set {_start} to ({_page} - 1) * 45
set {_end} to {_start} + 44
set {_gui} to chest inventory with 6 rows named "%{_title}% - ᴘᴀɢᴇ %{_page}%"
if {search::%uuid of {_p}%::result} is set:
clear {_temp::*}
loop {_list::*}:
if offlineplayer(loop-value)'s name contains {search::%uuid of {_p}%::result}:
add loop-value to {_temp::*}
set {_list::*} to {_temp::*}
if {_sortMode} is "richest":
sort {_list::*} in descending order by {order::%uuid of {_p}%::%input%::val}
set slot 50 of {_gui} to hopper named "<#ff4fd8>Sort by" with lore " <#ff4fd8>» &fʀɪᴄʜᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and "%nl% &f» &eᴄʟɪᴄᴋ ᴛᴏ sᴏʀᴛ" with custom model data 100005
else if {_sortMode} is "poorest":
sort {_list::*} in ascending order by {order::%uuid of {_p}%::%input%::val}
set slot 50 of {_gui} to hopper named "<#ff4fd8>Sort by" with lore " &7ʀɪᴄʜᴇsᴛ ᴘʟᴀʏᴇʀs" and " <#ff4fd8>» &fᴘᴏᴏʀᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and "%nl% &f» &eᴄʟɪᴄᴋ ᴛᴏ sᴏʀᴛ" with custom model data 100005
else if {_sortMode} is "richest-online":
clear {_temp::*}
loop {_list::*}:
if player(loop-value) is online:
add loop-value to {_temp::*}
sort {_temp::*} in descending order by {order::%uuid of {_p}%::%input%::val}
set {_list::*} to {_temp::*}
set slot 50 of {_gui} to hopper named "<#ff4fd8>Sort by" with lore " &7ʀɪᴄʜᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴘʟᴀʏᴇʀs" and " <#ff4fd8>» &fʀɪᴄʜᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and "%nl% &f» &eᴄʟɪᴄᴋ ᴛᴏ sᴏʀᴛ" with custom model data 100005
else if {_sortMode} is "poorest-online":
clear {_temp::*}
loop {_list::*}:
if player(loop-value) is online:
add loop-value to {_temp::*}
sort {_temp::*} in ascending order by {order::%uuid of {_p}%::%input%::val}
set {_list::*} to {_temp::*}
set slot 50 of {_gui} to hopper named "<#ff4fd8>Sort by" with lore " &7ʀɪᴄʜᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " <#ff4fd8>» &fᴘᴏᴏʀᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and "%nl% &f» &eᴄʟɪᴄᴋ ᴛᴏ sᴏʀᴛ" with custom model data 100005
else if {_sortMode} is "richest-offline":
clear {_temp::*}
loop {_list::*}:
if player(loop-value) is not online:
add loop-value to {_temp::*}
sort {_temp::*} in descending order by {order::%uuid of {_p}%::%input%::val}
set {_list::*} to {_temp::*}
set slot 50 of {_gui} to hopper named "<#ff4fd8>Sort by" with lore " &7ʀɪᴄʜᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " <#ff4fd8>» &fʀɪᴄʜᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and "%nl% &f» &eᴄʟɪᴄᴋ ᴛᴏ sᴏʀᴛ" with custom model data 100005
else if {_sortMode} is "poorest-offline":
clear {_temp::*}
loop {_list::*}:
if player(loop-value) is not online:
add loop-value to {_temp::*}
sort {_temp::*} in ascending order by {order::%uuid of {_p}%::%input%::val}
set {_list::*} to {_temp::*}
set slot 50 of {_gui} to hopper named "<#ff4fd8>Sort by" with lore " &7ʀɪᴄʜᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ᴘᴏᴏʀᴇsᴛ ᴏɴʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " &7ʀɪᴄʜᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and " <#ff4fd8>» &fᴘᴏᴏʀᴇsᴛ ᴏғғʟɪɴᴇ ᴘʟᴀʏᴇʀs" and "%nl% &f» &eᴄʟɪᴄᴋ ᴛᴏ sᴏʀᴛ" with custom model data 100005
loop {_list::*}:
set {_index} to (loop-index parsed as integer) - 1
if {_index} is between {_start} and {_end}:
set {_players_uuid} to loop-value
set {_str} to {order::%uuid of {_p}%::%{_players_uuid}%::str}
set {_val} to {order::%uuid of {_p}%::%{_players_uuid}%::val}
set {_rank} to getRankColor(getPlayerRank({_p}, {_players_uuid}, {sortMode::%uuid of {_p}%}))
set {_you} to " <#ffff40>(You)" if {_p} is player({_players_uuid}) else ""
set {_state} to "<#00ff40>● " if player({_players_uuid}) is online else "&7○ "
set {_myRank} to getRankColor(getPlayerRank({_p}, uuid of {_p}, {_sortMode}))
set slot ({_index} - {_start}) of {_gui} to {_str}'s skull named "%{_rank}%%{_state}%<#e8fff8>%{_str}%%{_you}%" with lore "%{_valName}%: <#00ff40>%{_val}%"
set slot 53 of {_gui} to arrow named "<#00ff6e>Next Page" with custom model data 100002 with lore " &f» <#ffff40>ᴄʟɪᴄᴋ ᴛᴏ ɢᴏ ғᴏʀᴡᴀʀᴅ" if size of {_list::*} > {_end}
set slot 45 of {_gui} to arrow named "<#ff002b>Previous Page" with custom model data 100001 with lore " &f» <#ffff40>ᴄʟɪᴄᴋ ᴛᴏ ɢᴏ ʙᴀᴄᴋ" if {_page} > 1
set slot 48 of {_gui} to anvil named "<#00bbff>Refresh" with lore " &f» &eᴄʟɪᴄᴋ ᴛᴏ ʀᴇғʀᴇsʜ" with custom model data 100000
set slot 52 of {_gui} to paper named "<#fcec03>Your rank" with lore " &f» %{_myRank}%" with custom model data 100006
if {_searchBtn} is true:
set slot 49 of {_gui} to oak sign named "<#ffbf00>Search" with custom model data 100003 with lore " &f» <#ffff40>ᴄʟɪᴄᴋ ᴛᴏ sᴇᴀʀᴄʜ" if size of {_list::*} > 15
else:
set slot 49 of {_gui} to barrier named "<#ff002b>Back" with custom model data 100004 with lore " &f» <#ffff40>ᴄʟɪᴄᴋ ᴛᴏ ɢᴏ ʙᴀᴄᴋ"
if size of {_list::*} > 0:
open {_gui} to {_p}
else:
send actionbar "&6No results found." to {_p}
play sound "minecraft:entity.villager.no" with volume 1 to {_p}
function getPlayerRank(p: player, target: string, sortMode: string) :: number:
clear {_ranks::*}
set {_ranks::*} to {result::%uuid of {_p}%::*}
if {_sortMode} contains "poorest":
sort {_ranks::*} in ascending order by {order::%uuid of {_p}%::%input%::val}
else:
sort {_ranks::*} in descending order by {order::%uuid of {_p}%::%input%::val}
set {_i} to 0
loop {_ranks::*}:
add 1 to {_i}
if loop-value is {_target}:
return {_i}
return -1
function getRankColor(rank: number) :: string:
set {_rankColor} to "<#d94302>&l%{_rank}%. "
if {_rank} is 1:
set {_rankColor} to "<#03fcdb>&l%{_rank}%. "
else if {_rank} is 2:
set {_rankColor} to "<#fffb12>&l%{_rank}%. "
else if {_rank} is 3:
set {_rankColor} to "<#ffffeb>&l%{_rank}%. "
return {_rankColor}
on quit:
delete {result::%uuid of player%::*}
delete {order::%uuid of player%::*}
delete {search::%uuid of player%::*}
Code:
#-----------------------------------------------------------------------
#Second Code >>>>>>>>
#The file inside CommandPanels/panels must have the name: "search_baltop.yml"
title: 'Search'
type: dialog
has-exit-button: false
escapable: false
columns: 1
layout:
'0':
- label
'1':
- input
'2':
- search
'3':
- cancel
items:
label:
type: text
name: 'Please type what you want to search for'
input:
type: input
name: 'Search:'
initial: '%player_name%'
width: 300
search:
type: button
name: '&aSearch'
width: 200
actions:
commands:
- '[chat] /baltop search %commandpanels_session_input%'
cancel:
type: button
name: '&cCancel'
width: 200
actions:
commands:
- '[chat] /baltop'