unbanning menu

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

cheesetheocto

New Member
Dec 4, 2023
7
0
1
23
can someone make something so that if someone right clicks an echo shard named "&4Revivor" it brings up a menu with the heads of the banned players and you can click on them to unban them?
 
Last edited:
You could try something like this

AppleScript:
function openUnbanMenu(p: player, page: integer = 0):
    if size of all banned players is 0:
        send "&cThere is no one to unban" to {_p}
    else if size of all banned players <= 54:
        set {_rows} to ceil(size of all banned players / 9)
        create a gui with virtual chest inventory with {_rows} rows named "&8Banned Users":
            loop all banned players:
                set {_player} to loop-offlineplayer
                make next gui slot with skull of {_player} named "&c%{_player}%" with lore "&aClick to unban":
                    unban {_player}
                    send "&aYou have unbanned %{_player}%" to {_p}
                    if size of all banned players is 0:
                        close {_p}'s inventory
                    else:
                        openUnbanMenu({_p})
    else:
        set {_start} to 1 + 45*{_page}
        set {_stop} to {_start} + 45
        create a gui with virtual chest inventory with 6 rows named "&8Banned Users (%{_page} + 1%/%ceil(size of all banned players / 45)%)":
            loop all banned players:
                if loop-iteration = {_stop}:
                    stop loop
                if loop-iteration >= {_start}:
                    set {_player} to loop-offlineplayer
                    make next gui slot with skull of {_player} named "&c%{_player}%" with lore "&aClick to unban":
                        unban {_player}
                        send "&aYou have unbanned %{_player}%" to {_p}
                        if size of all banned players < {_start}:
                            openUnbanMenu({_p}, {_page}-1)
                        else:
                            openUnbanMenu({_p}, {_page})
            make gui slot (integers between 45 and 53) with black stained glass pane named ""
            make gui slot 46 with arrow named "&cBack":
                openUnbanMenu({_p}, {_page}-1)
            if (size of all banned players >= {_stop}):
                make gui slot 52 with arrow named "&aNext":
                    openUnbanMenu({_p}, {_page} + 1)
    open last gui to {_p}

on right click with echo shard:
    name of player's tool is "&4Revivor"
    openUnbanMenu(player)
I did a little bit of testing but there could still be some issues. Let me know if you find anything.
Requires: skript-gui