Leon

zrób mi przedmiot .sk który po komędzie "/nadaj straszliwa dynia" daje graczowi z op dynię która się nazwa "&4&lStraszliwa Dynia" z opisem "&7Ten przedmiot jest z eventu Halloween 2027" i on po kliknię ci prawym przyciskiem na innego gracza daje mu dynie na głowe i nadaje mu efekty: spowolnienie 2 i mrok 2

Kodari AI
KodariOct 11 at 9:02 am 1
HalloweenCursedPumpkin
A Skript plugin that adds a cursed pumpkin item obtainable via the "/nadaj straszliwa dynia" command for OP players. The item displays as "&4&lStraszliwa Dynia" with lore "&7Ten przedmiot jest z eventu Halloween 2027". When right-clicked on another player, it equips the pumpkin on their head and applies Slowness II and Darkness II effects for a spooky Halloween experience.

Utworzę pojedynczy skrypt .sk: komendę dla operatora oraz użycie dyni na innym graczu z założeniem jej na głowę i efektami na 10 sekund.

Utworzyłem straszliwa_dynia.sk. Operator może użyć /nadaj straszliwa dynia, by otrzymać przedmiot. Kliknięcie nim innego gracza zakłada dynię na jego głowę, zużywa przedmiot i nakłada spowolnienie II oraz mrok II na 10 sekund.

Kodari can make mistakes. Review important code before using.
Files
straszliwa_dynia.sk
Code
1 34
straszliwa_dynia.sk
command /nadaj <text> <text>:
    trigger:
        if sender is not a player:
            send "&cTej komendy może użyć tylko operator będący graczem."
            stop
        if player is not op:
            send "&cMusisz mieć OP, aby użyć tej komendy."
            stop
        if arg-1 is not "straszliwa" or arg-2 is not "dynia":
            send "&cUżycie: /nadaj straszliwa dynia"
            stop
        set {_dynia} to pumpkin
        set name of {_dynia} to "&4&lStraszliwa Dynia"
        set lore of {_dynia} to "&7Ten przedmiot jest z eventu Halloween 2027"
        give {_dynia} to player
        send "&aOtrzymałeś &4&lStraszliwą Dynię&a."

on right click on entity:
    if clicked entity is a player:
        if clicked entity is not player:
            if player's tool is pumpkin:
                if name of player's tool is "&4&lStraszliwa Dynia":
                    cancel event
                    set {_target} to clicked entity
                    set {_dynia} to player's tool
                    set amount of {_dynia} to 1
                    if helmet of {_target} is not air:
                        give helmet of {_target} to {_target}
                    set helmet of {_target} to {_dynia}
                    remove 1 of player's tool from player
                    apply potion of slowness 2 to {_target} for 10 seconds
                    apply potion of darkness 2 to {_target} for 10 seconds
                    send "&4&lStraszliwa Dynia &7została założona na twoją głowę!" to {_target}
                    send "&aZałożyłeś Straszliwą Dynię na gracza %{_target}%&a."