Aller au contenu
  • 0

Arrive pas a supprimé une entité


Question

Posté(e)

Bonjour ,

Avec @tutur1004

nous avons codé un script , c'est a dire le pet qui vous suis parfois ,

On a reussi a crée ect , mais pas le supprimé

 

Voici le code:

 

command /petmini [<text>]:
   trigger:
       if arg 1 is set:
           if arg 1 is "me":
               set {_l} to location of player's head
               set {tonpet.%player%} to player
               remove 0.2 from y coord of {_l}
               add 0.5 to z coord of {_l}
               set {_l} to location .4 left of {_l}
               spawn an armor stand at {_l}
               set {armor::%uuid of player%} to last spawned entity
               set is visible of {armor::%uuid of player%} to true
               set show base plate of {armor::%uuid of player%} to false
               set has gravity of {armor::%uuid of player%} to false
               set show arms of {armor::%uuid of player%} to true
               set is small of {armor::%uuid of player%} to true
               set helmet of {armor::%uuid of player%} to player's skull
               set display name of last spawned entity to "&eMini %player%"
               set chestplate of {armor::%uuid of player%} to leather chestplate
               set leggings of {armor::%uuid of player%} to leather leggings
               set boots of {armor::%uuid of player%} to leather boots
               set {minime::%uuid of player%} to true
               wait 5 ticks
               teleport {armor::%uuid of player%} to {_l}
               set {pos.armor::%uuid of player%} to {_l}
               stop
#
command /petminiappel:
   trigger:
       if {minime::%uuid of player%} is true:
           teleport {armor::%uuid of player%} to player
           set {_l} to location of player's head
           set {pos.armor::%uuid of player%} to {_l}
#
command /petminiremove:
   trigger:
       if {minime::%uuid of player%} is true:
           set {_x} to x-location of {pos.armor::%uuid of player%}
           set {_y} to y-location of {pos.armor::%uuid of player%}            
           set {_z} to z-location of {pos.armor::%uuid of player%}
           kill all ArmorStand at {pos.armor::%uuid of player%}

Messages recommandés

  • 0
Posté(e)

Je ne l'ai pas testé, mais essaye toujours :p

 

command /petminiremove:
       trigger:
               if {minime::%uuid of player%} is true:
                       loop all armor stand in radius 1 around player:

                           kill loop-entities

 

Et le mieux à faire pour être sur que c'est son pet, c'est lui rajouter une metadata value à l'armor stand

 

set metadata value "Type" of last spawned armor stand to "armorstand:pet:%player%"

 

et détecter si c'est son pet au moment du loop

 

if loop-entities have metadata value "armorstand:pet:%player%":

  • 0
Posté(e)
Je ne l'ai pas testé, mais essaye toujours :p

 

command /petminiremove:
       trigger:
               if {minime::%uuid of player%} is true:
                       loop all armor stand in radius 1 around player:

                           kill loop-entities

 

Et le mieux à faire pour être sur que c'est son pet, c'est lui rajouter une metadata value à l'armor stand

 

set metadata value "Type" of last spawned armor stand to "armorstand:pet:%player%"

 

et détecter si c'est son pet au moment du loop

 

if loop-entities have metadata value "armorstand:pet:%player%":

On a déjà pensé à sa x) mais le truc c'est que le joueur est TP au spawn à chaque connections donc il n'y a aucunes armor stand à kill x(

  • 0
Posté(e)
Erreur ligne 4 et 3

 

command /petminiremove:
   trigger:
       loop {minime::%UUID of player%}:
       kill loop-value

Tu ne vois VRAIMENT pas l'erreur O_O ... Ce n'est pas de ma faute si tu recopies mal ce que j'ai mis x') #IndiceEspace

  • 0
Posté(e)

C bon sa c règler , mais mtn j'ai un problème a la ligne 11

 

command /petmini [<text>]:
   trigger:
       if arg 1 is set:
           if arg 1 is "me":
               set {_l} to location of player's head
               set {tonpet.%player%} to player
               remove 0.2 from y coord of {_l}
               add 0.5 to z coord of {_l}
               set {_l} to location .4 left of {_l}
               spawn an armor stand at {_l}
               set {armor::%uuid of player%} to last spawned entity
               set is visible of {armor::%uuid of player%} to true
               set show base plate of {armor::%uuid of player%} to false
               set has gravity of {armor::%uuid of player%} to false
               set show arms of {armor::%uuid of player%} to true
               set is small of {armor::%uuid of player%} to true
               set helmet of {armor::%uuid of player%} to player's skull
               set display name of last spawned entity to "&eMini %player%"
               set chestplate of {armor::%uuid of player%} to leather chestplate
               set leggings of {armor::%uuid of player%} to leather leggings
               set boots of {armor::%uuid of player%} to leather boots
               set {minime::%uuid of player%} to true
               wait 5 ticks
               teleport {armor::%uuid of player%} to {_l}
               set {pos.armor::%uuid of player%} to {_l}
               stop
#
command /petminiappel:
   trigger:
       if {minime::%uuid of player%} is true:
           teleport {armor::%uuid of player%} to player
           set {_l} to location of player's head
           set {pos.armor::%uuid of player%} to {_l}
#
command /petminiremove:
   trigger:
       loop {minime::%UUID of player%}:
           kill loop-value

  • 0
Posté(e)
C bon sa c règler , mais mtn j'ai un problème a la ligne 11

 

command /petmini [<text>]:
   trigger:
       if arg 1 is set:
           if arg 1 is "me":
               set {_l} to location of player's head
               set {tonpet.%player%} to player
               remove 0.2 from y coord of {_l}
               add 0.5 to z coord of {_l}
               set {_l} to location .4 left of {_l}
               spawn an armor stand at {_l}
               set {armor::%uuid of player%} to last spawned entity
               set is visible of {armor::%uuid of player%} to true
               set show base plate of {armor::%uuid of player%} to false
               set has gravity of {armor::%uuid of player%} to false
               set show arms of {armor::%uuid of player%} to true
               set is small of {armor::%uuid of player%} to true
               set helmet of {armor::%uuid of player%} to player's skull
               set display name of last spawned entity to "&eMini %player%"
               set chestplate of {armor::%uuid of player%} to leather chestplate
               set leggings of {armor::%uuid of player%} to leather leggings
               set boots of {armor::%uuid of player%} to leather boots
               set {minime::%uuid of player%} to true
               wait 5 ticks
               teleport {armor::%uuid of player%} to {_l}
               set {pos.armor::%uuid of player%} to {_l}
               stop
#
command /petminiappel:
   trigger:
       if {minime::%uuid of player%} is true:
           teleport {armor::%uuid of player%} to player
           set {_l} to location of player's head
           set {pos.armor::%uuid of player%} to {_l}
#
command /petminiremove:
   trigger:
       loop {minime::%UUID of player%}:
           kill loop-value

Il n'est censé y avoir aucune erreur à cette ligne là... En même temps si tu ne donnes ni le code en entier, ni l'erreur...

  • 0
Posté(e)

Oué mais sa marche pas:

Aucune erreur

 

command /pet [<text>]:
   trigger:
       if arg 1 is set:
           if arg 1 is "me":
               set {_l} to location of player
               set {_l} to location of player's head
               remove 0.2 from y coord of {_l}
               add 0.5 to z coord of {_l}
               set {_l} to location .4 left of {_l}
               spawn an armor stand at {_l}
               set {_s} to last spawned entity
               set is visible of {_s} to true
               set show base plate of {_s} to false
               set has gravity of {_s} to false
               set show arms of {_s} to true
               set is small of {_s} to true
               make {minime::%uuid of player%} pathfind to player with speed 1.5
               set helmet of {_s} to player's skull
               set display name of last spawned entity to "&eMini %player%"
               set chestplate of {_s} to leather chestplate
               set leggings of {_s} to leather leggings
               set boots of {_s} to leather boots
               set {minime::%uuid of player%} to true
               wait 5 ticks
               teleport {_s} to {_l}
               set {%player%.pos} to player's position
               stop

On teleport:
   Teleport {minime::%uuid of player%} to player

  • 0
Posté(e)
Pourrais-tu le corriger s'il te plaît ? =D

Bah justement je ne sais pas d'où vient l'erreur donc... je ne saurais pas le corriger, mais ton erreur (qui n'est pas affiché) est-ce un crash du serveur ?

  • 0
Posté(e)
C bon sa c règler , mais mtn j'ai un problème a la ligne 11

 

command /petmini [<text>]:
   trigger:
       if arg 1 is set:
           if arg 1 is "me":
               set {_l} to location of player's head
               set {tonpet.%player%} to player
               remove 0.2 from y coord of {_l}
               add 0.5 to z coord of {_l}
               set {_l} to location .4 left of {_l}
               spawn an armor stand at {_l}
               set {armor::%uuid of player%} to last spawned entity
               set is visible of {armor::%uuid of player%} to true
               set show base plate of {armor::%uuid of player%} to false
               set has gravity of {armor::%uuid of player%} to false
               set show arms of {armor::%uuid of player%} to true
               set is small of {armor::%uuid of player%} to true
               set helmet of {armor::%uuid of player%} to player's skull
               set display name of last spawned entity to "&eMini %player%"
               set chestplate of {armor::%uuid of player%} to leather chestplate
               set leggings of {armor::%uuid of player%} to leather leggings
               set boots of {armor::%uuid of player%} to leather boots
               set {minime::%uuid of player%} to true
               wait 5 ticks
               teleport {armor::%uuid of player%} to {_l}
               set {pos.armor::%uuid of player%} to {_l}
               stop
#
command /petminiappel:
   trigger:
       if {minime::%uuid of player%} is true:
           teleport {armor::%uuid of player%} to player
           set {_l} to location of player's head
           set {pos.armor::%uuid of player%} to {_l}
#
command /petminiremove:
   trigger:
       loop {minime::%UUID of player%}:
           kill loop-value

 

C'est assez impoli d'écrire avec le langage SMS sur le forum. Soigne ton écriture pour quelle soit lisible, merci^^ !

  • J'aime 1
  • 0
Posté(e)

Source: https://dev.bukkit.org/bukkit-plugins/skript/forum/scripts/79322-mini-me-no-mini-youuuu-1-8/

 

Voici le code: (Chez moi, il y a aucune erreur cependant il ne fonctionne pas !)

command /minime [<player>]:
trigger:
arg 1 is set:
make arg 1 execute command "/minime"
message "&7« &bMiniMe &7» &eForced %arg% to toggle their MiniMe!"
stop
{minime::%uuid of player%} isn't set:
set {minime::%uuid of player%} to false
{minime::%uuid of player%} is false:
loop all armor stands:
if name of loop-entity is "%player%sLittleBuddy":
delete loop-entity
set {_l} to location of player
set {_l} to location of player's head
remove 0.2 from y coord of {_l}
set {_l} to location .4 left of {_l}
set {_l2} to {_l}
set y coord of {_l2} to 0
spawn an armor stand at {_l2}
set {_s} to last spawned entity
set is visible of {_s} to true
set show base plate of {_s} to false
set has gravity of {_s} to false
set show arms of {_s} to true
set is small of {_s} to true
set helmet of {_s} to player's skull
set display name of last spawned entity to "&eMini %player%"
set name of last spawned entity to "%player%sLittleBuddy"
set chestplate of {_s} to leather chestplate
set leggings of {_s} to leather leggings
set boots of {_s} to leather boots
set {minime::%uuid of player%} to true
wait 5 ticks
teleport {_s} to {_l}
message "&7« &bMiniMe &7» &eYour MiniMe has come to you!"
stop
set {minime::%uuid of player%} to false
message "&7« &bMiniMe &7» &eYour MiniMe has left you!"
loop all armor stands:
if name of loop-entity is "%player%sLittleBuddy":
delete loop-entity
stop

on any movement:
{minime::%uuid of player%} is true:
set {_l} to location of player's head
remove 0.2 from y coord of {_l}
set {_l} to location .4 left of {_l}
loop all armor stands:
if name of loop-entity is "%player%sLittleBuddy":
teleport loop-entity to {_l}
set tool of loop-entity to tool of player
show 1 "cloud:0" particles at location of loop-entity for loop-entity offset by 0.4, 0.7, 0.4
set chestplate of loop-entity to chestplate of player
set leggings of loop-entity to leggings of player
set boots of loop-entity to boots of player
chestplate of loop-entity is air:
set chestplate of loop-entity to leather chestplate
leggings of loop-entity is air:
set leggings of loop-entity to leather chestplate
boots of loop-entity is air:
set boots of loop-entity to leather chestplate
stop

on join:
if {minime::%uuid of player%} is true:
loop all armor stands:
if name of loop-entity is "%player%sLittleBuddy":
delete loop-entity
set {_l} to location of player
set {_l} to location 1.2 left of player
spawn an armor stand at {_l}
set {_s} to last spawned entity
set is visible of {_s} to true
set show base plate of {_s} to false
set has gravity of {_s} to false
set show arms of {_s} to true
set is small of {_s} to true
set helmet of {_s} to player's skull
set display name of last spawned entity to "&eMini %player%"
set name of last spawned entity to "%player%sLittleBuddy"
set chestplate of {_s} to leather chestplate
set leggings of {_s} to leather leggings
set boots of {_s} to leather boots
message "&7« &bMiniMe &7» &eYour MiniMe has come to you!"
stop

on quit:
loop all armor stands:
if name of loop-entity is "%player%sLittleBuddy":
delete loop-entity
stop[/Code]

Oui j'ai recopié le style de @#PsYZiiK parce que c'est trop beau le vert avec les explications et tout O[/font][font=Verdana]u[/font][font=Tahoma]O[/font][/color]

×
×
  • 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.