Solved Selectors and arg-1

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Vxnku

Member
Nov 29, 2022
15
0
1
23
Script Version: 2.6.3
BoringSK v2.0
Skellett v2.0.3
SkRayFall v1.9.27
SkQuery v4.1.6
SkBee v2.5.1
Vault v1.7.3
WorldGuard v7.0.7
Script Author: Me (Vxnku)
Minecraft Version: 1.18.1
Full Code:
command /Infect <text> <player>:
permission: op
trigger:
if "%arg-1%" is "Zombie":
if the player doesn't have the scoreboard tag "Z":
send "Игрок %player% заражен Зомби Вирусом" to executor
if the player have the scoreboard tag "Z":
send "Игрок %player% уже Болеет Зомби вирусом" to executor
add "Z" to the scoreboard tags of player
1.#in this, i cant select a victim as subject for command, skript choose me

2.#this i dont know how to create Ivent, i need to check "if the player have the scoreboard tag "Z":" any time, or every tick maybe?
can i ask for help, i want to learn how to make, please help me

command /Infectcheck:
trigger:
loop all players
if the player have the scoreboard tag "Z":
send "Игрок %player% заражен Зомби Вирусом" to Vxnku
if player have {_Sick}:
stop
set {_Sick} to player
3.#in this moment i try to make varriable {_Sick}, what stops next event on when event happening
i want to add in end in the code remove {_Sick} from the player
 
Last edited:
{_sick} is a local variable. it only exists in that command. The condition "if player have {_sick}:" won't work as {_sick} is not set to anything. you can't remove {_sick} from the player if it doesn't even contain anything.

{_sick} — локальная переменная. он существует только в этой команде. Условие «если у игрока есть {_sick}:» не будет работать, так как {_sick} ничего не установлено. вы не можете удалить {_sick} из плеера, если он вообще ничего не содержит.
(Google Translate lol)
 
Last edited:
  • Like
Reactions: Vxnku
{_sick} is a local variable. it only exists in that command. The condition "if player have {_sick}:" won't work as {_sick} is not set to anything. you can't remove {_sick} from the player if it doesn't even contain anything.

{_sick} — локальная переменная. он существует только в этой команде. Условие «если у игрока есть {_sick}:» не будет работать, так как {_sick} ничего не установлено. вы не можете удалить {_sick} из плеера, если он вообще ничего не содержит.
(Google Translate lol)
i need to create some thing for varriable?
 
i need to create some thing for varriable?
Он говорит о том, что {_sick} это локальная переменная.
Она действует только там, где ты её впервые использовал.
Также локальная переменная {_Sick} не будет работать, если ты её ранее не установил.

Для примера две команды:
Code:
command heal:
   trigger:
       set {_player} to player #здесь мы установили локальную переменную {_player} на игрока
       heal {_player} #похилили игрока
    
command reset: #неправильное использование
   trigger:
       kill {_player} #здесь мы не можем использовать локальную переменную {_player}, нам надо создать новую локальную переменную для этой команды. Так как локальные переменные могут действовать только в одной области использования

command reset: #правильное использование
   trigger:
       set {_player} to player #здесь мы установили локальную переменную {_player} на игрока
       kill {_player} #убили игрока

В твоем случае локальные переменные не помогут. Нужно использовать полноценные - глобальные.
Также желательно, если у тебя if'ы связаны использовать else if
Пример:

Code:
on chat: #при использовании чата
    if player is "Vxnku": #если игрок Vxnku
        cancel event #отменить евент (проще говоря, запретить игроку написать сообщение)
    else if player is not "Vxnku" #если игрок не Vxnku
        broadcast "Ура, Vxnku написал в чат!"

Пример правильного скрипта:
Code:
command infect <text> <player>:
    permission: op
    trigger:
        if "%arg-1%" is "Zombie":
            if the player doesn't have the scoreboard tag "Z":
                send "Игрок %player% заражен Зомби Вирусом" to executor
            else if the player have the scoreboard tag "Z":
                send "Игрок %player% уже Болеет Зомби вирусом" to executor
                add "Z" to the scoreboard tags of player

command infectcheck:
    trigger:
        loop all players
            if the player have the scoreboard tag "Z":
                send "Игрок %player% заражен Зомби Вирусом" to player
 
Last edited:
Ввожу: /infect Zombie Kumiko
Итог: "Игрок Vxnku заражен Зомби вирусом"
Должно быть Kumiko
Code:
on consume:
    if the player have the scoreboard tag "Z":
        execute console command "/scoreboard players add %player% z.1 1"
        execute player command "/me не усваивает пищу"
        if scoreboard "z.1" bigger than 3 of player:
            execute console command "/effect give Vxnku minecraft:hunger 2 99 true"
            wait 5 seconds
            execute console command "/effect give Vxnku minecraft:hunger 2 99 true"

command infect <text> <player>:
    permission: op
    trigger:
        if "%arg-1%" is "Zombie":
            if the player doesn't have the scoreboard tag "Z":
                send "Игрок %player% заражен Зомби Вирусом" to executor
            else if the player have the scoreboard tag "Z":
                send "Игрок %player% уже Болеет Зомби вирусом" to executor
                add "Z" to the scoreboard tags of player
Этот плагин должен по нику <player>
Давать заражение, и я не понял как вставить "%arg-2%"
Хоть у меня в другом скрипте, это уже получалось
И вторая команда должна точно так же проверять у одного игрока, факт заражения
 

Attachments

  • upload_2022-11-30_21-49-25.png
    upload_2022-11-30_21-49-25.png
    194.2 KB · Views: 55
Ввожу: /infect Zombie Kumiko
Итог: "Игрок Vxnku заражен Зомби вирусом"
Должно быть Kumiko
Code:
on consume:
    if the player have the scoreboard tag "Z":
        execute console command "/scoreboard players add %player% z.1 1"
        execute player command "/me не усваивает пищу"
        if scoreboard "z.1" bigger than 3 of player:
            execute console command "/effect give Vxnku minecraft:hunger 2 99 true"
            wait 5 seconds
            execute console command "/effect give Vxnku minecraft:hunger 2 99 true"

command infect <text> <player>:
    permission: op
    trigger:
        if "%arg-1%" is "Zombie":
            if the player doesn't have the scoreboard tag "Z":
                send "Игрок %player% заражен Зомби Вирусом" to executor
            else if the player have the scoreboard tag "Z":
                send "Игрок %player% уже Болеет Зомби вирусом" to executor
                add "Z" to the scoreboard tags of player
Этот плагин должен по нику <player>
Давать заражение, и я не понял как вставить "%arg-2%"
Хоть у меня в другом скрипте, это уже получалось
И вторая команда должна точно так же проверять у одного игрока, факт заражения

К сожалению, за скоребоарды я не шарю.
Для чего ты вообще используешь теги скоребоардов?

Правильный пример твоей команды:

Code:
command infect <text> <player>:
    permission: op
    trigger:
        if "%arg-1%" is "Zombie":
            if the player doesn't have the scoreboard tag "Z":
                send "Игрок %arg-2% заражен Зомби Вирусом" to executor #переменная <player> выражается в виде того, кто ввел саму команду. Для того, чтобы получить ник игрока из команды, надо использовать arg (аргумент).
            else if the player have the scoreboard tag "Z":
                send "Игрок %arg-2% уже Болеет Зомби вирусом" to executor
                add "Z" to the scoreboard tags of player

command infectcheck:
    trigger:
        loop all players: #после лупа должно стоять двоеточие. Когда ты лупаешь игроков, исходная переменная игрока - loop-player, а не обычный player.
            if the loop-player have the scoreboard tag "Z":
                send "Игрок %loop-player% заражен Зомби Вирусом" to player

Но лучше всего сделать так: 
command infectcheck:
    trigger:
        loop all players: #после лупа должно стоять двоеточие. Когда ты лупаешь игроков, исходная переменная игрока - loop-player, а не обычный player.
            if the loop-player have the scoreboard tag "Z":
                add loop-player to {_lopped::*}
                send "Зараженные игроки: %{_lopped::*}%" to player
 
Last edited:
К сожалению, за скоребоарды я не шарю.
Для чего ты вообще используешь теги скоребоардов?

Правильный пример твоей команды:

Code:
command infect <text> <player>:
    permission: op
    trigger:
        if "%arg-1%" is "Zombie":
            if the player doesn't have the scoreboard tag "Z":
                send "Игрок %arg-2% заражен Зомби Вирусом" to executor #переменная <player> выражается в виде того, кто ввел саму команду. Для того, чтобы получить ник игрока из команды, надо использовать arg (аргумент).
            else if the player have the scoreboard tag "Z":
                send "Игрок %arg-2% уже Болеет Зомби вирусом" to executor
                add "Z" to the scoreboard tags of player

command infectcheck:
    trigger:
        loop all players: #после лупа должно стоять двоеточие. Когда ты лупаешь игроков, исходная переменная игрока - loop-player, а не обычный player.
            if the loop-player have the scoreboard tag "Z":
                send "Игрок %loop-player% заражен Зомби Вирусом" to player

Но лучше всего сделать так:
command infectcheck:
    trigger:
        loop all players: #после лупа должно стоять двоеточие. Когда ты лупаешь игроков, исходная переменная игрока - loop-player, а не обычный player.
            if the loop-player have the scoreboard tag "Z":
                add loop-player to {_lopped::*}
                send "Зараженные игроки: %{_lopped::*}%" to player

Теги скорбордов - часть работы моей комманды дата-пакеров, я реализую недостатки их датапаков, через скрипт, например
использования /trigger spell1 при пкм с предметом, и тд.
У меня РП Политический сервер с Магией, и вообще дикость
Я придумываю фигню, и реализую, отдаю в эту душу, но чувствую себя максимально тупым в скрипте, вот и в первый раз обратился сюда
Вот вчера, ты мне кинул проверку эффектов, а у меня не работало, и я начал орать и ныть, а после оказалось то что я был в /vanish
Спасибо за помощь, я хочу научиться
{_lopped::*} - ::* я вообще не понимаю что это
самому loop-players и loop, хочу его как-то впихнуть сюда:
Code:
command /secondmedhelp:
    cooldown: 110 seconds
    cooldown message: Ждите &4%remaining time% &f!
    trigger:
        if player has permission "group.medical":
            execute console command "/effect give %player% minecraft:regeneration 7 1 true"
            execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:instant_health 1 1 true"
            execute player command "/me Лечит окружающих"
        execute player command "/me Обработал раны спиртом"
        execute console command "/effect give %player% minecraft:instant_health 1 1 true"
        execute console command "/effect give %player% minecraft:nausea 2 5 true"
        chance of 45%:
            remove 1 water bottle with name "&6Спирт" from the player
            remove 1 potion with name "&6Спирт" from the player
on rightclick with a water bottle:
    if name of event-item is "&6Спирт":
        execute player command "/secondmedhelp"
on rightclick with a potion:
    if name of event-item is "&6Спирт":
        execute player command "/secondmedhelp"
       
command /firstmedhelp:
    cooldown: 32 seconds
    cooldown message: Ждите &c%remaining time% &f!
    trigger:
        remove 1 paper named "Бинт" from the player
        remove 1 paper named "Бинты" from the player
        remove 1 paper named "БИНТ" from the player
        remove 1 paper named "БИНТЫ" from the player
        remove 1 paper named "БИНт" from the player
        remove 1 paper named "БИНты" from the player
        remove 1 paper named "БИнт" from the player
        remove 1 paper named "БИнты" from the player
        remove 1 paper named "бинт" from the player
        remove 1 paper named "бинты" from the player
        chance of 5%:
            execute player command "/me Хорошо перевязал рану"
            execute console command "/effect give %player% minecraft:regeneration 5 2 true"
        chance of 70%:
            execute player command "/me Перевязал рану"
            execute console command "/effect give %player% minecraft:regeneration 5 1 true"
            if player has permission "group.medical":
                execute console command "/effect give %player% minecraft:regeneration 7 1 true"
                execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:regeneration 5 1 true"
                execute player command "/me Лечит окружающих"
        else:
            execute player command "/me Неудачно перевязал рану"
            if player has permission "group.medical":
                execute console command "/effect give %player% minecraft:regeneration 4 1 true"
                execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:regeneration 4 1 true"
on rightclick with a paper:
    if name of event-item is "Бинты":
        execute player command "/firstmedhelp"
on rightclick with a paper:
    if name of event-item is "Бинт":
        execute player command "/firstmedhelp"

command /firstmedhelp2:
    cooldown: 30 seconds
    cooldown message: Ждите &c%remaining time% &f!
    trigger:
        remove 1 paper named "&7Гипс" from the player
        chance of 80%:
            execute player command "/me Наложил гипс"
            execute console command "/effect give %player% minecraft:regeneration 12 0 true"
        else:
            execute player command "/me Неудалось"
on rightclick with a paper:
    if name of event-item is "&7Гипс":
        execute player command "/firstmedhelp2"

command /firstmedhelp3:
    cooldown: 21 seconds
    cooldown message: Ждите &c%remaining time% &f!
    trigger:
        remove 1 paper named "&8Шина" from the player
        chance of 80%:
            execute player command "/me Наложил шину"
            execute console command "/effect give %player% minecraft:regeneration 24 0 true"
            execute console command "/effect give %player% minecraft:slowness 12 0 true"
        else:
            execute player command "/me Неудалось"
on rightclick with a paper:
    if name of event-item is "&8Шина":
        execute player command "/firstmedhelp3"

command /secondmedhelp2:
    cooldown: 110 seconds
    cooldown message: Ждите &4%remaining time% &f!
    trigger:
        if player has permission "group.medical":
            execute console command "/effect give %player% minecraft:regeneration 7 1 true"
            execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:instant_health 1 1 true"
            execute player command "/me Лечит окружающих"
        execute player command "/me Обработал раны этанолом"
        execute console command "/effect give %player% minecraft:instant_health 1 1 true"
        chance of 15%:
            remove 1 water bottle with name "&cЭтанол" from the player
on rightclick with a water bottle:
    if name of event-item is "&cЭтанол":
        execute player command "/secondmedhelp2"
     
command /secondmedhelp3:
    cooldown: 110 seconds
    cooldown message: Ждите &4%remaining time% &f!
    trigger:
        if player has permission "group.medical":
            execute console command "/effect give %player% minecraft:regeneration 7 1 true"
            execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:instant_health 1 1 true"
            execute player command "/me Лечит окружающих"
        execute player command "/me Обработал раны ацетилхолином"
        execute console command "/effect give %player% minecraft:instant_health 1 1 true"
        chance of 35%:
            remove 1 water bottle with name "&2Ацетилхолин" from the player
on rightclick with a water bottle:
    if name of event-item is "&2Ацетилхолин":
        execute player command "/secondmedhelp3"

И да, хочу спросить
Как создать ивент?
Вот я хочу чтобы в период времени, была проверка шанса на событие

Code:
on consume:
    if the player have the scoreboard tag "Z":
        execute console command "/execute at @a[scores={z.1=37..}] run effect give @p minecraft:instant_damage"
        execute console command "/scoreboard players add %player% z.1 1"
        chance of 95%:
            execute player command "/undig"
            stop

command undig:
    trigger:
        execute player command "/me не усваивает пищу"
        execute console command "/effect give %player% minecraft:hunger 2 99 true"
        wait 100 ticks
        execute console command "/effect give %player% minecraft:hunger 2 99 true"
        wait 100 ticks
        chance of 25%:
            execute player command "/wommit"
            stop

command wommit:
    cooldown: 7 seconds
    cooldown message: &4Вы рвёте...
    trigger:
        execute player command "/me вырвал пищу"
        execute console command "/brew puke %player%"
        wait 2 seconds
        execute console command "/effect give %player% minecraft:hunger 4 99 true"
        execute console command "/effect give %player% minecraft:nausea 4 99 true"
Смог придумать только такое
 
Теги скорбордов - часть работы моей комманды дата-пакеров, я реализую недостатки их датапаков, через скрипт, например
использования /trigger spell1 при пкм с предметом, и тд.
У меня РП Политический сервер с Магией, и вообще дикость
Я придумываю фигню, и реализую, отдаю в эту душу, но чувствую себя максимально тупым в скрипте, вот и в первый раз обратился сюда
Вот вчера, ты мне кинул проверку эффектов, а у меня не работало, и я начал орать и ныть, а после оказалось то что я был в /vanish
Спасибо за помощь, я хочу научиться
{_lopped::*} - ::* я вообще не понимаю что это
самому loop-players и loop, хочу его как-то впихнуть сюда:
Code:
command /secondmedhelp:
    cooldown: 110 seconds
    cooldown message: Ждите &4%remaining time% &f!
    trigger:
        if player has permission "group.medical":
            execute console command "/effect give %player% minecraft:regeneration 7 1 true"
            execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:instant_health 1 1 true"
            execute player command "/me Лечит окружающих"
        execute player command "/me Обработал раны спиртом"
        execute console command "/effect give %player% minecraft:instant_health 1 1 true"
        execute console command "/effect give %player% minecraft:nausea 2 5 true"
        chance of 45%:
            remove 1 water bottle with name "&6Спирт" from the player
            remove 1 potion with name "&6Спирт" from the player
on rightclick with a water bottle:
    if name of event-item is "&6Спирт":
        execute player command "/secondmedhelp"
on rightclick with a potion:
    if name of event-item is "&6Спирт":
        execute player command "/secondmedhelp"
      
command /firstmedhelp:
    cooldown: 32 seconds
    cooldown message: Ждите &c%remaining time% &f!
    trigger:
        remove 1 paper named "Бинт" from the player
        remove 1 paper named "Бинты" from the player
        remove 1 paper named "БИНТ" from the player
        remove 1 paper named "БИНТЫ" from the player
        remove 1 paper named "БИНт" from the player
        remove 1 paper named "БИНты" from the player
        remove 1 paper named "БИнт" from the player
        remove 1 paper named "БИнты" from the player
        remove 1 paper named "бинт" from the player
        remove 1 paper named "бинты" from the player
        chance of 5%:
            execute player command "/me Хорошо перевязал рану"
            execute console command "/effect give %player% minecraft:regeneration 5 2 true"
        chance of 70%:
            execute player command "/me Перевязал рану"
            execute console command "/effect give %player% minecraft:regeneration 5 1 true"
            if player has permission "group.medical":
                execute console command "/effect give %player% minecraft:regeneration 7 1 true"
                execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:regeneration 5 1 true"
                execute player command "/me Лечит окружающих"
        else:
            execute player command "/me Неудачно перевязал рану"
            if player has permission "group.medical":
                execute console command "/effect give %player% minecraft:regeneration 4 1 true"
                execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:regeneration 4 1 true"
on rightclick with a paper:
    if name of event-item is "Бинты":
        execute player command "/firstmedhelp"
on rightclick with a paper:
    if name of event-item is "Бинт":
        execute player command "/firstmedhelp"

command /firstmedhelp2:
    cooldown: 30 seconds
    cooldown message: Ждите &c%remaining time% &f!
    trigger:
        remove 1 paper named "&7Гипс" from the player
        chance of 80%:
            execute player command "/me Наложил гипс"
            execute console command "/effect give %player% minecraft:regeneration 12 0 true"
        else:
            execute player command "/me Неудалось"
on rightclick with a paper:
    if name of event-item is "&7Гипс":
        execute player command "/firstmedhelp2"

command /firstmedhelp3:
    cooldown: 21 seconds
    cooldown message: Ждите &c%remaining time% &f!
    trigger:
        remove 1 paper named "&8Шина" from the player
        chance of 80%:
            execute player command "/me Наложил шину"
            execute console command "/effect give %player% minecraft:regeneration 24 0 true"
            execute console command "/effect give %player% minecraft:slowness 12 0 true"
        else:
            execute player command "/me Неудалось"
on rightclick with a paper:
    if name of event-item is "&8Шина":
        execute player command "/firstmedhelp3"

command /secondmedhelp2:
    cooldown: 110 seconds
    cooldown message: Ждите &4%remaining time% &f!
    trigger:
        if player has permission "group.medical":
            execute console command "/effect give %player% minecraft:regeneration 7 1 true"
            execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:instant_health 1 1 true"
            execute player command "/me Лечит окружающих"
        execute player command "/me Обработал раны этанолом"
        execute console command "/effect give %player% minecraft:instant_health 1 1 true"
        chance of 15%:
            remove 1 water bottle with name "&cЭтанол" from the player
on rightclick with a water bottle:
    if name of event-item is "&cЭтанол":
        execute player command "/secondmedhelp2"
    
command /secondmedhelp3:
    cooldown: 110 seconds
    cooldown message: Ждите &4%remaining time% &f!
    trigger:
        if player has permission "group.medical":
            execute console command "/effect give %player% minecraft:regeneration 7 1 true"
            execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:instant_health 1 1 true"
            execute player command "/me Лечит окружающих"
        execute player command "/me Обработал раны ацетилхолином"
        execute console command "/effect give %player% minecraft:instant_health 1 1 true"
        chance of 35%:
            remove 1 water bottle with name "&2Ацетилхолин" from the player
on rightclick with a water bottle:
    if name of event-item is "&2Ацетилхолин":
        execute player command "/secondmedhelp3"

И да, хочу спросить
Как создать ивент?
Вот я хочу чтобы в период времени, была проверка шанса на событие

Code:
on consume:
    if the player have the scoreboard tag "Z":
        execute console command "/execute at @a[scores={z.1=37..}] run effect give @p minecraft:instant_damage"
        execute console command "/scoreboard players add %player% z.1 1"
        chance of 95%:
            execute player command "/undig"
            stop

command undig:
    trigger:
        execute player command "/me не усваивает пищу"
        execute console command "/effect give %player% minecraft:hunger 2 99 true"
        wait 100 ticks
        execute console command "/effect give %player% minecraft:hunger 2 99 true"
        wait 100 ticks
        chance of 25%:
            execute player command "/wommit"
            stop

command wommit:
    cooldown: 7 seconds
    cooldown message: &4Вы рвёте...
    trigger:
        execute player command "/me вырвал пищу"
        execute console command "/brew puke %player%"
        wait 2 seconds
        execute console command "/effect give %player% minecraft:hunger 4 99 true"
        execute console command "/effect give %player% minecraft:nausea 4 99 true"
Смог придумать только такое
Понимаю тебя, тоже чувствовал себя глупым когда пришел сюда)). Политический сервер звучит интересно, возможно я как-нибудь зайду к вам поиграть.
Всегда пожалуйста.
::* - список
Например создадим команду для выбора победителя.

Code:
command winner:
    trigger:
        loop all players: #лопаем всех игроков сервера
            add loop-player to {_CanWinner::*} #добавляем всех игроков в список возможных победителей
            set {_winner} to random element out of {_CanWinner::*} #сетаем переменную {_winner} на рандомного игрока из списка {CanWinner::*}
            broadcast "Победил - %{_winner}%" #отправляем сообщение о победителе

Легче использовать действия сразу в евентах, а не подключать евенты к командам. Также не использовать по триста евентов для одной и той же вещи. Ну и ещё хотел бы дополнить, использовать консольные команды не практично, ведь все совершаемые тобой действия (выдача эффектов) есть в самом скрипте.
Версия твоего скрипта в моем видении:
Code:
on rightclick with a water bottle or potion: #вот это экономный способ использований евентов (бутылка с водой или зелье)
   if name of event-item is "&6Спирт":
       if {EthanolCooldown::%player%} is not set: #кулдаун можно сделать так
           set {EthanolCooldown::%player%} to 110 #устанавливаем переменную кулдауна на 110
           while {EthanolCooldown::%player%} is set: #пока переменная {EthanolCooldown::%player%} существует
               wait 1 second #задержка для евента while
               if {EthanolCooldown::%player%} > 0: #если переменная {EthanolCooldown::%player%} больше нуля
                   remove 1 from {EthanolCooldown::%player%} #отнимает единицу от {EthanolCooldown::%player%}
               else if {EthanolCooldown::%player%} = 0: #но если {EthanolCooldown::%player%} равна нулю
               clear {EthanolCooldown::%player%} #очищаем переменную {EthanolCooldown::%player%}
           if player has permission "group.medical":
               loop all players in radius 10 of player: #проверяет всех игроков в радиусе 10 блоков от тебя (лупает)
                   add loop-player to {_Healer::*} #добавляем их в список
                   apply potion of regeneration 1 without particles to loop-player for 7 seconds #как я говорил, можно использовать зелья, но это не практично за счет возможных багов. Легче просто добавлять рандомное число сердечек (например от 3 до 6) игроку. В данном случае я выдаю лопнутым игрокам (которые в радиусе 10 блоков от меня) эффект регенерации без партиклов на 7 секунд
                   loop 2 times: #повторить два раза
                       set {_player} to random element out of {_Healer::*}
                       heal {_player}
                   execute player command "/me Лечит окружающих"
           else if player don't have permission "group.medical": #как я говорил, желательно использовать else if, если if'ы связаны по смыслу.
               execute player command "/me Обработал раны спиртом"
               heal player
               apply potion of nausea 5 without particles to player for 2 seconds
               chance of 45%:
                   remove 1 water bottle or potion with name "&6Спирт" from the player
       else if {EthanolCooldown::%player%} is set: #кулдаун можно сделать так
           send "Подождите %{EthanolCooldown::%player%}% сек. для использования спирта" to player

on rightclick with a paper: #здесь кулдаун ты можешь добавить сам
    if name of event-item is "Бинты" or "Бинт":
        remove 1 of paper named "Бинт" from the player #я без понятия, что у вас там с бинтами, раз ты их 300 раз удаляешь из инвентаря игрока меняя буквы
        remove 1 of paper named "Бинты" from the player
        chance of 5%:
            execute player command "/me Хорошо перевязал рану"
            apply potion of regeneration 5 without particles to player for 2 seconds
        chance of 70%:
            execute player command "/me Перевязал рану"
            apply potion of regeneration 5 without particles to player for 1 seconds
            if player has permission "group.medical":
                execute console command "/effect give %player% minecraft:regeneration 7 1 true"
                execute player command "/effect give @p[limit=2,sort=nearest,distance=0..3] minecraft:regeneration 5 1 true"
                execute player command "/me Лечит окружающих"
        else: #без понятия к чему тут else, но если работает, то пусть будет так
            execute player command "/me Неудачно перевязал рану"
            if player has permission "group.medical":
                apply potion of regeneration 1 without particles to player for 4 seconds
Все остальное ты сам сможешь изменить по моему примеру.
Ивент можно сделать руками.
У тебя во consume куча ненужных команд, все можно сделать по 1 ивент. У тебя тут и так стоит шанс события:
Code:
on consume:
    if the player have the scoreboard tag "Z":
        execute console command "/execute at @a[scores={z.1=37..}] run effect give @p minecraft:instant_damage" #вообще сюда лезть не буду
        execute console command "/scoreboard players add %player% z.1 1"
        chance of 95%:
            execute player command "/me не усваивает пищу"
            execute console command "/effect give %player% minecraft:hunger 2 99 true"
            wait 100 ticks
            execute console command "/effect give %player% minecraft:hunger 2 99 true"
            wait 100 ticks
            chance of 25%:
                execute player command "/me вырвал пищу"
                execute console command "/brew puke %player%"
                wait 2 seconds
                apply potion of hunger 99 without particles to player for 4 seconds
                apply potion of nausea 99 without particles to player for 4 seconds
                stop #зачем тут стояло два стопа вообще не знаю
 
Status
Not open for further replies.