Aller au contenu
  • 0

Question

Posté(e) (modifié)

Version de Minecraft : 1.16.1
Version de Skript : 2.5-alpha6

Addons utilisés: aucun

Type du skript : Freeze au combat avec une bâton renommé Matraque

Description du script :

J'ai déjà développé mon script il n'y a aucune erreur. Quand je frappe le joueur il deviens bien freeze mais quand je le re frappe il ne se passe rien j'ai fait une commande pour vérifier que la variable sois bien sur true avant de post mon topic.

 

Le code :

on damage:
	if attacker is a player:
		if victim is a player:

			if attacker is holding a stick:
				if name of attacker's tool is "&eMatraque":

					if {garde.freeze.%UUID of victim%} is true:
						send "&aTu es relaché" to victim
						send "&aTu as relaché &7%victim%." to attacker
						set {garde.freeze.%UUID of victim%} to false

					else:

						if {garde.freeze.%UUID of victim%} is false:
							send "&cUn garde ta capturer." to victim
							send "&cTu as capturé &7%victim%." to attacker
							set {garde.freeze.%UUID of victim%} to true

							set {loc.%UUID of victim%} to location of victim
							while {garde.freeze.%UUID of victim%} is true:
								if {loc.%UUID of victim%} is not "%location of victim%":
									teleport victim to {loc.%UUID of victim%}
									wait 2 tick

						if {garde.freeze.%UUID of victim%} is not set:
							send "&cUn garde ta capturer." to victim
							send "&cTu as capturé &7%victim%." to attacker
							set {garde.freeze.%UUID of victim%} to true

							set {loc.%UUID of victim%} to location of victim
							while {garde.freeze.%UUID of victim%} is true:
								if {loc.%UUID of victim%} is not "%location of victim%":
									teleport victim to {loc.%UUID of victim%}
									wait 2 tick

				else:
					cancel event

 

Merci pour vos aide

Modifié par DaddyWharz

9 réponses à cette question

Messages recommandés

  • 0
Posté(e) (modifié)

essaye d'enlever ta partie false et de mettre delete {garde.freeze.%UUID's vistim%}

on damage:
	if attacker is a player:
		if victim is a player:
			if attacker is holding a stick:
				if name of attacker's tool is "&eMatraque":
					if {garde.freeze.%UUID of victim%} is true:
						send "&aTu es relaché" to victim
						send "&aTu as relaché &7%victim%." to attacker
						delete {garde.freeze.%UUID of victim%}

					else:
						send "&cUn garde ta capturer." to victim
						send "&cTu as capturé &7%victim%." to attacker
						set {garde.freeze.%UUID of victim%} to true
						set {loc.%UUID of victim%} to location of victim
						while {garde.freeze.%UUID of victim%} is true:
						if {loc.%UUID of victim%} is not "%location of victim%":
							teleport victim to {loc.%UUID of victim%}
							wait 2 tick

				else:
					cancel event
Révélation
Révélation
Révélation
Révélation
Révélation
Révélation
Révélation
Révélation

T'es beau

 

 

 

 

 

 

 

 

 

Modifié par coralinejtm
  • 0
Posté(e)
Il y a 15 heures, coralinejtm a dit :

on damage: if attacker is a player: if victim is a player: if attacker is holding a stick: if name of attacker's tool is "&eMatraque": if {garde.freeze.%UUID of victim%} is true: send "&aTu es relaché" to victim send "&aTu as relaché &7%victim%." to attacker delete {garde.freeze.%UUID of victim%} else: send "&cUn garde ta capturer." to victim send "&cTu as capturé &7%victim%." to attacker set {garde.freeze.%UUID of victim%} to true set {loc.%UUID of victim%} to location of victim while {garde.freeze.%UUID of victim%} is true: if {loc.%UUID of victim%} is not "%location of victim%": teleport victim to {loc.%UUID of victim%} wait 2 tick else: cancel event

ça ne fonctionne toujours pas je pense que c'est à cause de la boucle que les dégâts ne fonctionne pas 

  • 0
Posté(e) (modifié)

@DaddyWharz essaye de delete le loc

comme ça:

on damage:
	if attacker is a player:
		if victim is a player:
			if attacker is holding a stick:
				if name of attacker's tool is "&eMatraque":
					if {garde.freeze.%UUID of victim%} is true:
						send "&aTu es relaché" to victim
						send "&aTu as relaché &7%victim%." to attacker
						delete {garde.freeze.%UUID of victim%}
                        delete {loc.%UUID of victim%}

					else:
						send "&cUn garde ta capturer." to victim
						send "&cTu as capturé &7%victim%." to attacker
						set {garde.freeze.%UUID of victim%} to true
						set {loc.%UUID of victim%} to location of victim
						while {garde.freeze.%UUID of victim%} is true:
						if {loc.%UUID of victim%} is not "%location of victim%":
							teleport victim to {loc.%UUID of victim%}
							wait 2 tick

				else:
					cancel event

 

 

Modifié par coralinejtm
  • 0
Posté(e)
il y a 14 minutes, coralinejtm a dit :

@DaddyWharz essaye de delete le loc

comme ça:


on damage:
	if attacker is a player:
		if victim is a player:
			if attacker is holding a stick:
				if name of attacker's tool is "&eMatraque":
					if {garde.freeze.%UUID of victim%} is true:
						send "&aTu es relaché" to victim
						send "&aTu as relaché &7%victim%." to attacker
						delete {garde.freeze.%UUID of victim%}
                        delete {loc.%UUID of victim%}

					else:
						send "&cUn garde ta capturer." to victim
						send "&cTu as capturé &7%victim%." to attacker
						set {garde.freeze.%UUID of victim%} to true
						set {loc.%UUID of victim%} to location of victim
						while {garde.freeze.%UUID of victim%} is true:
						if {loc.%UUID of victim%} is not "%location of victim%":
							teleport victim to {loc.%UUID of victim%}
							wait 2 tick

				else:
					cancel event

 

 

J'ai finalement changer de méthode ça fonctionne :
 

on damage:
	if attacker is a player:
		if victim is a player:

			if attacker is holding a stick:
				if name of attacker's tool is "&eMatraque":

					if {garde.freeze.%UUID of victim%} is not set:
						send "&cUn &bgarde &cta capturer ne bouge plus !" to victim
						send "&7Tu as capturé &e%victim%." to attacker
						send "&7Clique droit avec la &eMatraque &7pour le relacher." to attacker
						set {garde.freeze.%UUID of victim%} to true

						set {loc.%UUID of victim%} to location of victim
						while {garde.freeze.%UUID of victim%} is true:
							if {loc.%UUID of victim%} is not "%location of victim%":
								teleport victim to {loc.%UUID of victim%}
								wait 2 tick

					if {garde.freeze.%UUID of victim%} is false:
						send "&cUn &bgarde &cta capturer ne bouge plus !" to victim
						send "&7Tu as capturé &e%victim%." to attacker
						send "&7Clique droit avec la &eMatraque &7pour le relacher." to attacker
						set {garde.freeze.%UUID of victim%} to true

						set {loc.%UUID of victim%} to location of victim
						while {garde.freeze.%UUID of victim%} is true:
							if {loc.%UUID of victim%} is not "%location of victim%":
								teleport victim to {loc.%UUID of victim%}
								wait 2 tick

				else:
					cancel event
			else:
				cancel event		

on rightclick:
	if player is holding a stick:
		if name of player's tool is "&eMatraque":
			set {_p} to targeted entity
			loop all players:
				if loop-player is {_p}:
					if {garde.freeze.%UUID of loop-player%} is true:
						send "&aLe &bGarde &ata relacher, tu as de la chance." to loop-player
						send "&7Tu as relaché &e%loop-player%." to player
						set {garde.freeze.%UUID of loop-player%} to false

 

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.