Patryk Ratka

zrob mi skrypt bingo na /startbingo tepa nas gdziec i na offhand zostajemy map kart z różnimi ityemani i jak zostaniemy tą kartke nie mozna wywalic albo wyzrucisz i jak zginiesz to nie tracisz to, jak zdobencie ktos jakis tam ityem ktory tam byl to bedzie zielony i pisze na chatcie jaki ityem to byl i kto to zdobyl niech tam napisze {nick gracza w minecraft} zdobył {item ktory zdobył} i jak to wywali to i tak bedzie zielone i na /bingostop tepa nas do 0 0, i na /bingorestart to robimy odnowa wszystko te bingo czyli nowe itemy ktore mamy zdobyc ale jako .sk

Kodari AI
KodariOct 23 at 8:25 pm 1
BingoCardGame
Creates a Minecraft bingo minigame via Skript. /startbingo teleports players to a designated location and gives them a map card in their offhand displaying a grid of random items. The card cannot be dropped or removed. When a player obtains an item from the card, it turns green and a chat message announces "{player} zdobył {item}". Even if the item is later lost, it stays green. /bingostop teleports everyone to 0 0, and /bingorestart resets the game with new random items. The script manages inventory restrictions, item tracking, and game state.

Zapisz jako plugins/Skript/scripts/bingo.sk, a potem użyj /sk reload bingo. Komendy wymagają uprawnienia bingo.admin. Start i restart teleportują graczy do spawnu świata; stop teleportuje ich na X=0, Z=0, na najwyższy bezpieczny blok.

Kodari can make mistakes. Review important code before using.
Files
bingo.sk
Code
1 175
bingo.sk
options:
    prefix: &6[Bingo]&r
    bingo-items: 25

function bingoSetCard(p: player):
    clear {_lore::*}
    add "&7Twoje cele:" to {_lore::*}
    loop {@bingo-items} times:
        set {_goal} to {bingo.targets::%loop-number%}
        if {bingo.completed::%loop-number%} is set:
            add "&a✓ %{_goal}%" to {_lore::*}
        else:
            add "&7• %{_goal}%" to {_lore::*}
    set {_card} to map named "&6Karta Bingo"
    set lore of {_card} to {_lore::*}
    set offhand tool of {_p} to {_card}

function bingoGiveCard(p: player):
    if {_p}'s offhand tool is not map named "&6Karta Bingo":
        if {_p}'s offhand tool is not air:
            set {_oldItem} to {_p}'s offhand tool
            give {_oldItem} to {_p}
    bingoSetCard({_p})

function bingoSnapshot(p: player):
    loop {@bingo-items} times:
        set {_goal} to {bingo.targets::%loop-number%}
        set {_amount} to amount of {_goal} in {_p}'s inventory
        set {bingo.lastcount::%{_p}%::%loop-number%} to {_amount}

function bingoScanPlayer(p: player):
    loop {@bingo-items} times:
        set {_goal} to {bingo.targets::%loop-number%}
        set {_amount} to amount of {_goal} in {_p}'s inventory
        if {bingo.lastcount::%{_p}%::%loop-number%} is not set:
            set {bingo.lastcount::%{_p}%::%loop-number%} to {_amount}
        else:
            if {_amount} > {bingo.lastcount::%{_p}%::%loop-number%}:
                set {bingo.lastcount::%{_p}%::%loop-number%} to {_amount}
                if {bingo.completed::%loop-number%} is not set:
                    set {bingo.completed::%loop-number%} to true
                    broadcast "{@prefix} &a%name of {_p}% zdobył(a) &e%{_goal}%&a!"
                    loop all players:
                        if loop-player's offhand tool is map named "&6Karta Bingo":
                            bingoSetCard(loop-player)
            else:
                set {bingo.lastcount::%{_p}%::%loop-number%} to {_amount}

function bingoStart():
    delete {bingo.targets::*}
    delete {bingo.completed::*}
    delete {bingo.lastcount::*}
    delete {bingo.pool::*}

    add diamond to {bingo.pool::*}
    add emerald to {bingo.pool::*}
    add iron ingot to {bingo.pool::*}
    add gold ingot to {bingo.pool::*}
    add copper ingot to {bingo.pool::*}
    add coal to {bingo.pool::*}
    add redstone to {bingo.pool::*}
    add lapis lazuli to {bingo.pool::*}
    add amethyst shard to {bingo.pool::*}
    add quartz to {bingo.pool::*}
    add obsidian to {bingo.pool::*}
    add blaze rod to {bingo.pool::*}
    add ender pearl to {bingo.pool::*}
    add slimeball to {bingo.pool::*}
    add bone to {bingo.pool::*}
    add string to {bingo.pool::*}
    add gunpowder to {bingo.pool::*}
    add leather to {bingo.pool::*}
    add spider eye to {bingo.pool::*}
    add feather to {bingo.pool::*}
    add sugar to {bingo.pool::*}
    add bread to {bingo.pool::*}
    add apple to {bingo.pool::*}
    add oak log to {bingo.pool::*}
    add cobblestone to {bingo.pool::*}
    add sand to {bingo.pool::*}
    add glass to {bingo.pool::*}
    add cactus to {bingo.pool::*}
    add wheat to {bingo.pool::*}
    add carrot to {bingo.pool::*}
    add potato to {bingo.pool::*}
    add pumpkin to {bingo.pool::*}
    add melon slice to {bingo.pool::*}
    add flint to {bingo.pool::*}
    add prismarine shard to {bingo.pool::*}
    add glowstone dust to {bingo.pool::*}
    add nautilus shell to {bingo.pool::*}
    add phantom membrane to {bingo.pool::*}
    add honey bottle to {bingo.pool::*}
    add raw iron to {bingo.pool::*}
    add raw gold to {bingo.pool::*}

    set {_available::*} to {bingo.pool::*}
    loop {@bingo-items} times:
        set {_goal} to random element out of {_available::*}
        set {bingo.targets::%loop-number%} to {_goal}
        remove {_goal} from {_available::*}

    set {bingo.active} to true
    loop all players:
        bingoGiveCard(loop-player)
        bingoSnapshot(loop-player)
        teleport loop-player to spawn point of world of loop-player

command /startbingo:
    permission: bingo.admin
    permission message: &cNie masz uprawnień do rozpoczęcia Bingo.
    trigger:
        if {bingo.active} is true:
            send "{@prefix} &cBingo już trwa. Użyj /bingorestart, aby wylosować nowe cele."
            stop
        bingoStart()
        broadcast "{@prefix} &aBingo rozpoczęte! Karta jest w twojej drugiej ręce."

command /bingorestart:
    permission: bingo.admin
    permission message: &cNie masz uprawnień do restartu Bingo.
    trigger:
        bingoStart()
        broadcast "{@prefix} &eBingo zrestartowane — wylosowano nowe cele!"

command /bingostop:
    permission: bingo.admin
    permission message: &cNie masz uprawnień do zatrzymania Bingo.
    trigger:
        delete {bingo.active}
        delete {bingo.targets::*}
        delete {bingo.completed::*}
        delete {bingo.lastcount::*}
        loop all players:
            if loop-player's offhand tool is map named "&6Karta Bingo":
                set loop-player's offhand tool to air
            set {_target} to location at 0, 0, 0 in world of loop-player
            set {_highest} to highest block at {_target}
            set {_target} to location of {_highest}
            add 1 to y-coordinate of {_target}
            teleport loop-player to {_target}
        broadcast "{@prefix} &cBingo zatrzymane. Wszyscy zostali teleportowani na X=0, Z=0."

every 5 ticks:
    if {bingo.active} is true:
        loop all players:
            bingoScanPlayer(loop-player)

on join:
    if {bingo.active} is true:
        wait 1 tick
        bingoGiveCard(player)
        bingoSnapshot(player)

on drop:
    if {bingo.active} is true:
        if event-item is map named "&6Karta Bingo":
            cancel event

on swap hand items:
    if {bingo.active} is true:
        if player's offhand tool is map named "&6Karta Bingo":
            cancel event

on death of player:
    if {bingo.active} is true:
        loop drops:
            if loop-item is map named "&6Karta Bingo":
                remove loop-item from drops

on respawn:
    if {bingo.active} is true:
        wait 1 tick
        bingoGiveCard(player)
        bingoSnapshot(player)