Aller au contenu
  • 0

épuration possible de mon skript de menotte ajoutée un on damage


Question

Posté(e) (modifié)

Version de Minecraft : 1.12.2
Version de Skript : 2.6.0

Addons utilisés: aucun

Type du skript : menottes qui s'applique au bout de 5s et quand il met de dommage sa tp sur le gars qui lui as mis

Description du script :

Bonjour, je voudrais juste savoir comment épuré mon skript et si possible d'ajouter un on damage qui tp le gars qui prend les domages au gars qui lui mets, seulement quand il est menotté (tout fonctionne actuellement)

command /menotte:
    permission: scp.staff.members
    permission message: &cSCP-BSEW-ERREUR: tu ne peux pas effectuer cette commande petit saligot!
    trigger:
        give 1 stick named "&bMenotte" to player

on right click on a player:
    if player's tool is stick named "&bMenotte":
        if {menotte::%targeted entity%} is not set:
            set {_loc} to player's position
            set {_Te} to targeted entity
            send "&7Vous étes en train d'etre menotté..."
            if {_loc} = player's position:
                send action bar "&a.&7...." to player 
                play sound "block.note.pling" with volume 0.1 at player
                if {_loc} = player's position:
                    wait 1 second
                    send action bar "&a..&7..." to player 
                    play sound "block.note.pling" with volume 0.2 at player
                    if {_loc} = player's position:
                        wait 1 second
                        send action bar "&a...&7.." to player
                        play sound "block.note.pling" with volume 0.3 at player
                        if {_loc} = player's position: 
                            wait 1 second
                            send action bar "&a....&7." to player
                            play sound "block.note.pling" with volume 0.4 at player
                            if {_loc} = player's position: 
                                wait 1 second
                                if {_loc} = player's position:
                                    set {menotte::%targeted entity%} to true
                                    send action bar "&a....." to player
                                    play sound "block.note.chime" with volume 1 at player 
                                    send "&7Tu est menotté" to targeted entity
                                    send "&7Tu vien de le menotté" to player
                                    apply slowness 3 to targeted entity for 9999 days

                                else:
                                    delete {menotte::%targeted entity%}
                                    send "&6 Vous avez bougé !" to player
                                    send action bar "&c....." to player
                                    play sound "block.note.bass" with volume 0.4 at player

                            else:
                                delete {menotte::%targeted entity%}
                                send "&6 Vous avez bougé !" to player
                                send action bar "&c....." to player
                                play sound "block.note.bass" with volume 0.4 at player

                        else:
                            delete {menotte::%targeted entity%}
                            send "&6 Vous avez bougé !" to player
                            send action bar "&c....." to player
                            play sound "block.note.bass" with volume 0.4 at player

                    else:
                        delete {menotte::%targeted entity%}
                        send "&6 Vous avez bougé !" to player
                        send action bar "&c....." to player
                        play sound "block.note.bass" with volume 0.4 at player

                else:
                    delete {menotte::%targeted entity%}
                    send "&6 Vous avez bougé !" to player
                    send action bar "&c....." to player
                    play sound "block.note.bass" with volume 0.4 at player

            else:
                send "&6 Vous avez bougé !" to player
                send action bar "&c....." to player
                play sound "block.note.bass" with volume 0.4 at player

        else:
            delete {menotte::%targeted entity%}
            send "&7Tu est demenotté" to targeted entity
            send "&7Tu vien de le demenotté" to player
            remove slowness from targeted entity

on damage:
    if attacker is player:
        cancel event
        send "&7vous étes actuelement trainé de force." to victim
        if {menotte::%victim%} is true:
            set {_a} to 3
            while {_a} > 0:
                remove 1 from {_a}
                wait 2 second
                make console execute command "/tp %victim% %attacker% "

 

Modifié par Fayikauz
  • J'aime 1

2 réponses à cette question

Messages recommandés

  • 0
Posté(e) (modifié)

Hello @Fayikauz,
Et bien voilà, je trouve ton code très intéressant, je te propose ma version inspiré de la tienne (en espérant avoir répondu à tes attentes) ! 😊

Révélation

on load:
    clear {handcuffing::*}
    clear {menotte::*}
    loop all players:
        unhandcuff(loop-player)

on join:
    if {handcuffing::*} contains player:
        remove player from {handcuffing::*}
    unhandcuff(player)

on quit:
    if {handcuffing::*} contains player:
        remove player from {handcuffing::*}
    unhandcuff(player)

function getLoadBar(size: number = 0) :: text:
    if {_size} = 0:
        return "&7[■■■■■■■■■■■■■■■■■■■■]"
    else if {_size} = 1:
        return "&7[&a■&7■■■■■■■■■■■■■■■■■■■&7]"
    else if {_size} = 2:
        return "&7[&a■■&7■■■■■■■■■■■■■■■■■■&7]"
    else if {_size} = 3:
        return "&7[&a■■■&7■■■■■■■■■■■■■■■■■&7]"
    else if {_size} = 4:
        return "&7[&a■■■■&7■■■■■■■■■■■■■■■■&7]"
    else if {_size} = 5:
        return "&7[&a■■■■■&7■■■■■■■■■■■■■■■&7]"
    else if {_size} = 6:
        return "&7[&a■■■■■■&7■■■■■■■■■■■■■■&7]"
    else if {_size} = 7:
        return "&7[&a■■■■■■■&7■■■■■■■■■■■■■&7]"
    else if {_size} = 8:
        return "&7[&a■■■■■■■■&7■■■■■■■■■■■■&7]"
    else if {_size} = 9:
        return "&7[&a■■■■■■■■■&7■■■■■■■■■■■&7]"
    else if {_size} = 10:
        return "&7[&a■■■■■■■■■■&7■■■■■■■■■■&7]"
    else if {_size} = 11:
        return "&7[&a■■■■■■■■■■■&7■■■■■■■■■&7]"
    else if {_size} = 12:
        return "&7[&a■■■■■■■■■■■■&7■■■■■■■■&7]"
    else if {_size} = 13:
        return "&7[&a■■■■■■■■■■■■■&7■■■■■■■&7]"
    else if {_size} = 14:
        return "&7[&a■■■■■■■■■■■■■■&7■■■■■■&7]"
    else if {_size} = 15:
        return "&7[&a■■■■■■■■■■■■■■■&7■■■■■&7]"
    else if {_size} = 16:
        return "&7[&a■■■■■■■■■■■■■■■■&7■■■■&7]"
    else if {_size} = 17:
        return "&7[&a■■■■■■■■■■■■■■■■■&7■■■&7]"
    else if {_size} = 18:
        return "&7[&a■■■■■■■■■■■■■■■■■■&7■■&7]"
    else if {_size} = 19:
        return "&7[&a■■■■■■■■■■■■■■■■■■■&7■&7]"
    else if {_size} = 20:
        return "&7[&a■■■■■■■■■■■■■■■■■■■■&7]"
    else:
        return "&7[■■■■■■■■■■■■■■■■■■■■&7]"

function unhandcuff(p: player):
    clear {menotte::%{_p}%}
    remove slowness from {_p}

function handcuff(p: player, v: player):
    {_p} is holding stick of unbreaking 1 with all flags hidden named "&bMenotte"
    {menotte::%{_v}%} is set:
        unhandcuff({_v})
        send "&7Tu est demenotté" to {_v}
        send "&7Tu vien de le demenotté" to {_p}
        stop
        set {_barlvl} to 0
    {handcuffing::*} doesn't contain {_v}
    add {_v} to {handcuffing::*}
    wait 3 ticks
    set {_refloc::%{_p}%} to location of {_p}
    set {_refloc::%{_v}%} to location of {_v}
    loop 20 time:
        wait 3 ticks
        if target entity of {_p} is not {_v}:
            remove {_v} from {handcuffing::*}
            send action bar "&c[■■■■■■■■■■■■■■■■■■■■]" to {_p}
            play sound "block.note.bass" with volume 0.4 at {_p}
            stop
        if x-coordinate of {_refloc::%{_p}%} is not x-coordinate of {_p}'s location:
            remove {_v} from {handcuffing::*}
            send action bar "&c[■■■■■■■■■■■■■■■■■■■■]" to {_p}
            play sound "block.note.bass" with volume 0.4 at {_p}
            stop
        if y-coordinate of {_refloc::%{_p}%} is not y-coordinate of {_p}'s location:
            remove {_v} from {handcuffing::*}
            send action bar "&c[■■■■■■■■■■■■■■■■■■■■]" to {_p}
            play sound "block.note.bass" with volume 0.4 at {_p}
            stop
        if z-coordinate of {_refloc::%{_p}%} is not z-coordinate of {_p}'s location:
            remove {_v} from {handcuffing::*}
            send action bar "&c[■■■■■■■■■■■■■■■■■■■■]" to {_p}
            play sound "block.note.bass" with volume 0.4 at {_p}
            stop
        if x-coordinate of {_refloc::%{_v}%} is not x-coordinate of {_v}'s location:
            remove {_v} from {handcuffing::*}
            send action bar "&c[■■■■■■■■■■■■■■■■■■■■]" to {_p}
            play sound "block.note.bass" with volume 0.4 at {_p}
            stop
        if y-coordinate of {_refloc::%{_v}%} is not y-coordinate of {_v}'s location:
            remove {_v} from {handcuffing::*}
            send action bar "&c[■■■■■■■■■■■■■■■■■■■■]" to {_p}
            play sound "block.note.bass" with volume 0.4 at {_p}
            stop
        if z-coordinate of {_refloc::%{_v}%} is not z-coordinate of {_v}'s location:
            remove {_v} from {handcuffing::*}
            send action bar "&c[■■■■■■■■■■■■■■■■■■■■]" to {_p}
            play sound "block.note.bass" with volume 0.4 at {_p}
            stop
        play sound "block.note.pling" with volume 0.1 at {_p}
        send action bar getLoadBar({_barlvl}) to {_p}
        add 1 to {_barlvl}
    set {menotte::%{_v}%} to true
    remove {_v} from {handcuffing::*}
    send "&7Tu est menotté" to {_v}
    send action bar "&a[■■■■■■■■■■■■■■■■■■■■]" to {_p}
    apply slowness 3 to {_v} for 999999 days
    play sound "block.note.chime" with volume 0.4 at {_p}

command /menotte [<text>]:
    permission: scp.staff.members
    permission message: &cSCP-BSEW-ERREUR: tu ne peux pas effectuer cette commande petit saligot!
    trigger:
        give 1 stick of unbreaking 1 with all flags hidden named "&bMenotte" to player

on right click on a player:
    handcuff(player, clicked player)

on damage of player:
    attacker is player
    {menotte::%victim%} is set
    cancel event
    send action bar "&7vous étes actuelement trainé de force." to victim
    push victim in direction of damager with force -0.5
    wait 5 ticks
    set {_x} to x-coordinate of attacker
    set {_y} to y-coordinate of attacker
    set {_z} to z-coordinate of attacker
    set {_world} to world of attacker
    set {_yaw} to yaw of victim
    set {_pitch} to pitch of victim
    teleport victim to location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch})

 

Passe une bonne soirée et amuses toi bien !

 

 

handcuff.sk

Modifié par Nyu
Update (Correction Spam Maintenir Rightclick + Correction getLoadBar qui retournais une valeur NULL ce qui causait un crash...)
  • Oui 1
Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.