Aller au contenu
Invité

Entitées qui marchent pas

Messages recommandés

Invité

Bonsoir, j'aimerais faire des familiers (pets) sauf qu'en faisant spawn des animaux cela ne marche pas :

 

J'ai une partie avec des armorstans qui marchent parfaitement !

 

Et la je test avec des animaux sauf que ça marche uniquement pour le cochon :o

Les autres animaux ne marchent pas ..

En gros le spawn marche, ils nous suivent sauf qu'au moment du remove, sa delete bien la variable mais l'animal n'est pas remove

 

Et je ne comprend pas pourquoi

 

Le problème est dans la suppression des animaux, le spawn et tp marchent !

 

function FamiliersMenu(p: player, page: text):
   if {_page} is "2":
       open virtual chest inventory with size 6 named "{@gui_prefix} &7» &fMenu &f&l2" to {_p}
       wait 2 tick
       format gui slot 1 of {_p} with player head with custom nbt "{@Pig}" to run:
           if {_p} has permission "familier.spawn.pig" or "familier.spawn.*" or "familier.*":
               FamiliersGetAnimals(player, "pig")
               set {familier.%{_p}%} to "pig"
               close {_p}'s inventory
           else:
               show an action bar from "{@NoPermission}" to {_p}
       format gui slot 2 of {_p} with player head with custom nbt "{@Cow}" to run:
           if {_p} has permission "familier.spawn.cow" or "familier.spawn.*" or "familier.*":
               FamiliersGetAnimals(player, "cow")
               set {familier.%{_p}%} to "cow"
               close {_p}'s inventory
           else:
               show an action bar from "{@NoPermission}" to {_p}
       format gui slot 3 of {_p} with player head with custom nbt "{@Sheep}" to run:
           if {_p} has permission "familier.spawn.sheep" or "familier.spawn.*" or "familier.*":
               FamiliersGetAnimals(player, "sheep")
               set {familier.%{_p}%} to "sheep"
               close {_p}'s inventory
           else:
               show an action bar from "{@NoPermission}" to {_p}
       format gui slot 4 of {_p} with player head with custom nbt "{@Ocelot}" to run:
           if {_p} has permission "familier.spawn.ocelot" or "familier.spawn.*" or "familier.*":
               FamiliersGetAnimals(player, "ocelot")
               set {familier.%{_p}%} to "ocelot"
               close {_p}'s inventory
           else:
               show an action bar from "{@NoPermission}" to {_p}
       format gui slot 5 of {_p} with player head with custom nbt "{@Chicken}" to run:
           if {_p} has permission "familier.spawn.chicken" or "familier.spawn.*" or "familier.*":
               FamiliersGetAnimals(player, "chicken")
               set {familier.%{_p}%} to "chicken"
               close {_p}'s inventory
           else:
               show an action bar from "{@NoPermission}" to {_p}
       format gui slot 6 of {_p} with player head with custom nbt "{@Mushroom Cow}" to run:
           if {_p} has permission "familier.spawn.mushroom_cow" or "familier.spawn.*" or "familier.*":
               FamiliersGetAnimals(player, "mushroom_cow")
               set {familier.%{_p}%} to "mushroom_cow"
               close {_p}'s inventory
           else:
               show an action bar from "{@NoPermission}" to {_p}

       format gui slot 48 of {_p} with player head with custom nbt "{@Arrow Left}" to run:
           wait 1 ticks
           close {_p}'s inventory
           FamiliersMenu(player, "1")
   format gui slot 49 of {_p} with barrier named "&4» &cSupprimer le familier" to run:
       delete {familier.%{_p}%}
       kill {fam.%{_p}%}
function FamiliersGetAnimals(p: player, e: text):
   send "%{fam.%{_p}%}%" to {_p}
   kill {fam.%{_p}%}
   wait 2 ticks
   set {_l} to location of {_p}'s head
   remove 0.5 from y coord of {_l}
   set {_l} to location .7 right of {_l}
   if {_e} is "pig":
       spawn a pig at {_l}
   if {_e} is "cow":
       spawn a cow at {_l}
   if {_e} is "sheep":
       spawn a sheep at {_l}
   if {_e} is "ocelot":
       spawn a ocelot at {_l}
   if {_e} is "chicken":
       spawn a chicken at {_l}
   if {_e} is "mushroom_cow":
       spawn a mooshroom at {_l}
   set {fam.%{_p}%} to spawned entity
   send "%spawned entity%" to {_p}
   send "%{fam.%{_p}%}%" to {_p}
   set {protect.%spawned entity%} to true
   if {@FamiliersNameSet} is true:
       add "{NoGravity:1b,Invulnerable:1,CustomNameVisible:1,CustomName:{@FamiliersName},Age:-25000,IsBaby:1,Size:0,NoAI:1}" to nbt of {fam.%{_p}%}
   if {@FamiliersNameSet} is false:
       add "{NoGravity:1b,Invulnerable:1,Age:-25000,IsBaby:1,Size:0,NoAI:1}" to nbt of {fam.%{_p}%}
on any move:
   if {@FamiliersPos} is "right":
       set {_l} to location of player's head
       remove 0.5 from y coord of {_l}
       set {_l} to location .7 right of {_l}
       if {@FamiliersAnimationSneak} is true:
           if player is sneaking:
               if {familier.%player%} is set:
                   add "{Pose:{Body:[20f,0f,0f]}}" to nbt of {fam.%player%}
                   teleport {fam.%player%} to {_l}
                   wait 0.5 ticks
           else:
               if {familier.%player%} is set:
                   teleport {fam.%player%} to {_l}
                   add "{Pose:{Body:[0f,0f,0f]}}" to nbt of {fam.%player%}
                   wait 1 ticks
                   stop
   if {@FamiliersPos} is "left":
       set {_l} to location of player's head
       remove 0.5 from y coord of {_l}
       set {_l} to location .7 left of {_l}
       if {@FamiliersAnimationSneak} is true:
           if player is sneaking:
               if {familier.%player%} is set:
                   add "{Pose:{Body:[20f,0f,0f]}}" to nbt of {fam.%player%}
                   teleport {fam.%player%} to {_l}
                   wait 0.5 ticks
           else:
               if {familier.%player%} is set:
                   teleport {fam.%player%} to {_l}
                   add "{Pose:{Body:[0f,0f,0f]}}" to nbt of {fam.%player%}
                   wait 1 ticks
                   stop

Partager ce message


Lien à poster
Partager sur d’autres sites
Invité

Merci , je vais y réfléchir :D

Partager ce message


Lien à poster
Partager sur d’autres sites

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