Aller au contenu
  • 0

Mouton Soigneur


Question

Posté(e)

Bonjour depuis 2 jours je bosse sur un Skript qui a pour but de ressemble au SheepWars mais pour mon serveur entre amis mais j'ai un problème avec se si gentil mouton soigneur voici mon code :

 

 

on right click with pink wool:
   cancel event#au cas ou il le place
   make player shoot a pink sheep at speed 0
   remove 1 pink wool from player
every 1 second:
   if distance between the player and pink sheeps is less than 5:
   heal player by 1 heart
   loop pink sheeps:
       set name of loop-entity to "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|"
       set the colour of loop-entity to pink
       wait 5 seconds
       if name of loop-entity contains "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
           kill loop-entity   
on death of sheep: #Clear drop mouton
   if name of sheep contains "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
       clear drops

 

mais je n'arrive pas a mettre la regeneration dés qu'un joueur s'approche du mouton j'ai essayer plusieurs code comme :

if distance between the player and loop-entity is less than 5: ou encore donner un effet de regeneration au joueur a proximité mais cela me pose problème.

 

Voici le code entier si au cas ou il y aura d'autre erreur

 

on right click with white wool: #Le mouton abordaj

remove 1 white wool from player

shoot a sheep from the player

wait 10 tick

make player ride the last shot sheep

loop white sheeps:

set name of loop-entity to "&a&k|&e&k|&d&k| &b&l Abordaaaaj &a&k|&e&k|&d&k|"

set the colour of loop-entity to white

wait 5 seconds

if name of loop-entity contains "&a&k|&e&k|&d&k| &b&l Abordaaaaj &a&k|&e&k|&d&k|":

kill loop-entity

on damage: #Annule tout degats chute

if damage type is fall:

cancel event

on death of sheep: #Clear drop mouton

if name of sheep contains "&a&k|&e&k|&d&k| &b&l Abordaaaaj &a&k|&e&k|&d&k|":

clear drops

 

 

on right click with a red wool:
   cancel event
   remove 1 red wool from player
   make player shoot a red sheep at speed 3

every 1 second:
   loop red sheeps:
       if name of the loop-entity is not set:
           set the name of the loop-entity to "0"
       set {_name} to name of the loop-entity parsed as number
       if {_name} is 5:
           delete the loop-entity
           wait 1 tick
           create an explosion of force 3 at location of loop-entity
       else:
           set the name of the loop-entity to "%{_name} + 1%"



on right click with pink wool:
cancel event
make player shoot a pink sheep at speed 0
remove 1 pink wool from player
every 1 second:
if distance between pink sheeps and player is less than 5:
heal player by 1 heart
loop pink sheeps:
	set name of loop-entity to "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|"
	set the colour of loop-entity to pink
	wait 5 seconds
	if name of loop-entity contains "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
		kill loop-entity	
on death of sheep: #Clear drop mouton
if name of sheep contains "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
	clear drops

 

Voila Merci pour votre aide

18 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Je tient aussi a rajouter que dés que je fais spawner un mouton soigneur donc rose . Si deux moutons rose sont en vie un seul des deux aura le nom de REGEN et les autre le deviendrons quand l'autre est mort mais qu'un part un. Ce que je voudrait c'est que plusieurs mouton spawn avec le nom REGEN et qu'il n'attend pas que l'autre meurt pour pouvoir mourir 5 seconde après être nommé REGEN donc je veux qu'il meurt bien tous au bout de 5 secondes.

  • 0
Posté(e)

Code non testé, dis moi s'il y a une/des erreur(s):

on right click with pink wool:
   cancel event
   spawn a pink sheep named "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|" at player
   set {_a} to last spawned sheep
   remove 1 of tool from tool
   wait 5 seconds
   kill {_a}
every 1 second:
   loop all players:
       loop all sheeps in radius 5 around the player:
           if name of loop-entity is "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
               heal loop-player by 1 heart
on death of sheep: #Clear drop mouton
   if name of sheep contains "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
       clear drops

  • 0
Posté(e)

[Skript] Reloading Test.sk...

'sheep named "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|" at player' is not an entity type (Test.sk, line 3: spawn a pink sheep named "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|" at player')

'radius 5 around the player' is not a world (Test.sk, line 10: loop all sheeps in radius 5 around the player:')

[Skript] Encountered 2 errors while reloading Test.sk!

Et si je peux rajouter une chose le mouton ne spawn pas

  • 0
Posté(e)

on right click with pink wool:
   cancel event
   spawn a pink sheep at player
   set {_a} to last spawned sheep
 set name of {_a} to "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|"
   remove 1 of tool from tool
   wait 5 seconds
   kill {_a}
every 1 second:
   loop all players:
       loop all sheeps in radius 5 around loop-player:
           if name of loop-entity is "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
               heal loop-player by 1 heart
on death of sheep: #Clear drop mouton
   if name of sheep contains "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
       clear drops

Ca devrait etre mieux, sinon change:

loop all sheeps in radius 5 around loop-player:

par

loop all entities in radius 5 around loop-player:
  loop-entity is a pink sheep

  • 0
Posté(e)

on right click with pink wool:
   cancel event
   spawn a pink sheep at player
   set {_a} to last spawned sheep
   set name of {_a} to "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|"
   remove 1 of tool from tool
   wait 5 seconds
   kill {_a}
every 1 second:
   loop all players:
       loop all entities in radius 5 around loop-player:        
	loop-entity is a pink sheep
       heal loop-player by 1 heart
on death of sheep: #Clear drop mouton
   if name of sheep contains "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
       clear drops

 

Je l'est modifiez un peux mais j'ai 1 erreur et un bug trouvé par ma part

 

'raduis 5 around loop-player: (signe bizarre 2 fois ) loop-entity is not a world line 49: loop all entities in radius 5 around loop-player: loop-entity is a pink sheep

 

et le bug que j'ai trouvé c'est que la boucle de regen sur le joueur est infinie même après sa mort. Enfaite je regen constament

  • 0
Posté(e)

Tu n'a pas bien mis les espaces c'est normal:

every 1 second:
   loop all players:
       loop all entities in radius 5 around loop-player:       
           loop-entity is a pink sheep
           heal loop-player by 1 heart

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

Merci cela marche mais si je peux te demander une dernier faveur j'ai essayer de faire une systeme de partie ect ... les join mais rien ne marchait malheureusement je n'ai plus les code.

Se serait vraiment sympa

  • 0
Posté(e)

Pour ceux qui veulent le skript entier tenez

on right click with pink wool:
   cancel event
   spawn a pink sheep at player
   set {_a} to last spawned sheep
   set name of {_a} to "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|"
   remove 1 of tool from tool
   wait 5 seconds
   kill {_a}
every 1 second:
   loop all players:
       loop all entities in radius 5 around loop-player:      
           loop-entity is a pink sheep
           heal loop-player by 1 heart
on death of sheep: #Clear drop mouton
   if name of sheep contains "&a&k|&e&k|&d&k| &b&l REGEN &a&k|&e&k|&d&k|":
       clear drops

 

Merci Pour Votre Aide

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