Izz Darwisy Bin Iskandar

Make this skript to 26.2

Kodari AI
KodariNov 4 at 11:44 am 2

the_worker.sk uses standard Skript syntax, so it doesn’t need a Minecraft-specific rewrite for 26.2. Skript 2.17.1 lists Paper 26.2 within its supported range.

Place the file in plugins/Skript/scripts/ and run /sk reload the_worker. I haven’t tested it on a live 26.2 server; if reload reports errors, send them to me.

Izz Darwisy Bin Iskandar

Where can i get the skript

Kodari AI
KodariNov 4 at 11:46 am 1

The script is in your project workspace as the_worker.sk. Open it there and copy it into your server’s plugins/Skript/scripts/ folder, then run /sk reload the_worker.

Kodari can make mistakes. Review important code before using.
Files
the_worker.sk
Code
1 263
the_worker.sk
# O Trabalhador — adaptação em Skript.
# O progresso avança a cada 20 minutos em que o jogador está online.

options:
    prefix: &8[&4O Trabalhador&8]&r
    event-interval: 3 minutes
    day-duration: 20 minutes
    max-events-per-day: 3

function workerStage(p: player) :: integer:
    set {_day} to {worker.day::%uuid of {_p}%}
    if {_day} is not set:
        return 1
    if {_day} <= 5:
        return 1
    if {_day} <= 10:
        return 2
    if {_day} <= 15:
        return 3
    if {_day} <= 20:
        return 4
    return 5

function summonWorker(p: player):
    set {_spot} to location 12 blocks behind {_p}
    spawn a wither skeleton at {_spot}
    set {_worker} to last spawned entity
    set name of {_worker} to "&0O Trabalhador"
    set AI of {_worker} to false
    wait 15 seconds
    if {_worker} is alive:
        delete {_worker}

function workerDialogue(p: player):
    set {_day} to {worker.day::%uuid of {_p}%}
    set {_stage} to workerStage({_p})
    send "{@prefix} &7Ele fica em silêncio por um instante." to {_p}

    if {worker.final::%uuid of {_p}%} is set:
        send "&8O Trabalhador: &fEu só queria que alguém soubesse que estive aqui." to {_p}
        send "&7Responda com &f/worker answer reconheco &7ou &f/worker answer seguir&7." to {_p}
        stop

    if {_stage} is 1:
        send "&8O Trabalhador: &fAinda há tempo. Não precisa olhar para trás." to {_p}
    else if {_stage} is 2:
        send "&8O Trabalhador: &fVocê também passa muito tempo construindo?" to {_p}
        send "&7Responda com &f/worker answer sim&7, &f/worker answer nao &7ou &f/worker answer porque&7." to {_p}
    else if {_stage} is 3:
        send "&8O Trabalhador: &fEu deixava tudo pronto. Depois, outras pessoas assinavam o trabalho." to {_p}
        send "&7Responda com &f/worker answer sim&7, &f/worker answer nao &7ou &f/worker answer porque&7." to {_p}
    else if {_stage} is 4:
        send "&8O Trabalhador: &fEu construí mundos para pessoas que nunca perguntaram quem os fez." to {_p}
        send "&7Você pode responder com &f/worker answer sim&7, &f/worker answer nao &7ou &f/worker answer porque&7." to {_p}
    else:
        send "&8O Trabalhador: &fVocê acha que aquilo que eu fiz valeu alguma coisa?" to {_p}
        send "&7Responda com &f/worker answer sim&7, &f/worker answer nao&7 ou &f/worker answer porque&7." to {_p}

function workerEvent(p: player):
    set {_id} to uuid of {_p}
    if {worker.events::%{_id}%} is not set:
        set {worker.events::%{_id}%} to 0
    if {worker.events::%{_id}%} >= {@max-events-per-day}:
        stop

    add 1 to {worker.events::%{_id}%}
    set {_stage} to workerStage({_p})
    set {_roll} to random integer between 1 and 100

    if {_stage} is 1:
        if {_roll} <= 50:
            send "{@prefix} &8Um ruído de madeira veio de algum lugar distante." to {_p}
            play sound "block.wooden_door.close" at {_p}
        else:
            send "{@prefix} &8Por um instante, a noite pareceu mais silenciosa." to {_p}
            play sound "ambient.cave" at {_p}
    else if {_stage} is 2:
        send "{@prefix} &8Você sente que alguém está parado longe, observando." to {_p}
        play sound "entity.enderman.stare" at {_p}
        if {_roll} <= 35:
            summonWorker({_p})
    else if {_stage} is 3:
        send "{@prefix} &8O Trabalhador: &fVocê voltou a este lugar. Eu me lembro." to {_p}
        play sound "block.wooden_door.close" at {_p}
        if {_roll} <= 40:
            summonWorker({_p})
    else if {_stage} is 4:
        send "{@prefix} &8O Trabalhador: &fPassei anos construindo coisas para os outros." to {_p}
        play sound "entity.enderman.stare" at {_p}
        if {_roll} <= 45:
            summonWorker({_p})
    else:
        send "{@prefix} &8O Trabalhador: &fEu não queria assustar você. Só queria ser lembrado." to {_p}
        play sound "ambient.cave" at {_p}
        if {_roll} <= 50:
            summonWorker({_p})

on join:
    set {_id} to uuid of player
    if {worker.day::%{_id}%} is not set:
        set {worker.day::%{_id}%} to 1
    if {worker.events::%{_id}%} is not set:
        set {worker.events::%{_id}%} to 0

every {@day-duration}:
    loop all players:
        set {_id} to uuid of loop-player
        if {worker.day::%{_id}%} is not set:
            set {worker.day::%{_id}%} to 1
        if {worker.day::%{_id}%} < 30:
            add 1 to {worker.day::%{_id}%}
            set {worker.events::%{_id}%} to 0
            set {_day} to {worker.day::%{_id}%}

            if {_day} is 6:
                send "{@prefix} &8Uma silhueta aparece ao longe — e some quando você olha de novo." to loop-player
            else if {_day} is 11:
                send "{@prefix} &8O Trabalhador: &fEu conheço o som de um lugar depois que todos vão embora." to loop-player
            else if {_day} is 16:
                send "{@prefix} &8O Trabalhador: &fEu fazia mapas, sistemas e eventos. Quase sempre sozinho." to loop-player
            else if {_day} is 21:
                send "{@prefix} &8O Trabalhador: &fEu não queria destruir nada. Só queria que alguém notasse." to loop-player
            else if {_day} is 25:
                set {worker.final::%{_id}%} to true
                send title "&8Uma oficina esquecida" with subtitle "&7Há alguém esperando por você." to loop-player
                send "{@prefix} &8O Trabalhador: &fEu só queria que alguém soubesse que estive aqui." to loop-player
                summonWorker(loop-player)

every {@event-interval}:
    loop all players:
        set {_id} to uuid of loop-player
        if {worker.day::%{_id}%} is not set:
            set {worker.day::%{_id}%} to 1
        if {worker.events::%{_id}%} is not set:
            set {worker.events::%{_id}%} to 0
        if {worker.events::%{_id}%} < {@max-events-per-day}:
            set {_stage} to workerStage(loop-player)
            set {_chance} to 1
            if {_stage} is 2:
                set {_chance} to 5
            else if {_stage} is 3:
                set {_chance} to 10
            else if {_stage} is 4:
                set {_chance} to 15
            else if {_stage} is 5:
                set {_chance} to 20
            set {_roll} to random integer between 1 and 100
            if {_roll} <= {_chance}:
                workerEvent(loop-player)

on right click on entity:
    if uncolored name of clicked entity is "O Trabalhador":
        cancel event
        workerDialogue(player)

command /worker [<text>] [<text>]:
    executable by: players
    trigger:
        set {_action} to arg-1
        if {_action} is not set:
            set {_action} to "dialogue"

        if {_action} is "dialogue":
            workerDialogue(player)
            stop

        if {_action} is "answer":
            if arg-2 is not set:
                send "{@prefix} &7Uso: &f/worker answer <sim|nao|porque|reconheco|seguir>" to player
                stop
            set {_answer} to arg-2
            if {_answer} is "sim":
                set {worker.choice::%uuid of player%} to "sim"
                send "{@prefix} &8O Trabalhador: &fObrigado por me contar." to player
            else if {_answer} is "nao":
                set {worker.choice::%uuid of player%} to "nao"
                send "{@prefix} &8O Trabalhador: &fTudo bem. Eu só precisava perguntar." to player
            else if {_answer} is "porque":
                set {worker.choice::%uuid of player%} to "porque"
                send "{@prefix} &8O Trabalhador: &fPorque ninguém perguntou antes." to player
            else if {_answer} is "reconheco":
                if {worker.final::%uuid of player%} is not set:
                    send "{@prefix} &7Ainda não chegou a hora dessa resposta." to player
                    stop
                set {worker.ending::%uuid of player%} to "reconhecido"
                send "{@prefix} &8O Trabalhador: &fEntão meu trabalho não desapareceu por completo." to player
                send "{@prefix} &7Ele deixa um bilhete dobrado para você." to player
                give player 1 paper named "&8Bilhete da oficina"
            else if {_answer} is "seguir":
                if {worker.final::%uuid of player%} is not set:
                    send "{@prefix} &7Ainda não chegou a hora dessa resposta." to player
                    stop
                set {worker.ending::%uuid of player%} to "seguir"
                send "{@prefix} &8O Trabalhador: &fEntendo. Obrigado por ter ficado até aqui." to player
                give player 1 paper named "&8Bilhete da oficina"
            else:
                send "{@prefix} &7Resposta desconhecida." to player
            stop

        if {_action} is "status":