Aller au contenu
ThzCrapy

Gros probléme skript pratice

Messages recommandés

Bien le bonjour, j'ai un gros problème avec mon skript pratice, je vous explique quand un joueur duel un autre l'autre accepte et ils sont téléporter dans une arènes avec un kit il s'affronte celui qui gagne est redirigez au spawn et celui qui perd aussi jusque la pas de soucis mais si le joueur se deconnecte sans avois taper l'autre joueur bah l'autre joueur se retrouve dans l'arène et je n'arrivez a le teleporte a une location j'ai vraiment besoin d'aide j'ai tout essayer en vaint, j'espère avoir était claire si vous ne comprenez pas je peux vous répliquer, merci sur se bonne soirée.

on join:
	set {duelinstant.%player%} to false
	set {dueltemp.%player%} to false
	teleport player to {spawn.pratice}
	set {player.%player%} to player
	set {online.%player%} to true
	if player is world "ver1":
		teleport player in world
	if player is in world "clay1":
		teleport player to {spawn.pratice}
	if player is in world "test":
		teleport player to {spawn.pratice}

command /setspawn:
	permission: setspawn.pratice
	trigger:
		set {spawn.pratice} to location of player
		send "&aspawn set" to player
		
command /spawn:
	permission: spawn.pratice
	trigger:
		teleport player to {spawn.pratice}
	
command /duel <text>:
	usage: duel player
	trigger:	
		if arg 1 is "%player%":		
			send "&cTu ne peux pas te défié toi méme" to player
		else:
			if {duelinstant.%arg 1%} is false:
				if {dueltemp.%player%} is false:
					open chest with 1 row named "&e&lDuel %arg 1%" to player
					wait 1 ticks
					format slot 0 of player with 1 of splash Health potion item named "&6&lNo debuff" to close then run [make console execute command "requete %arg 1% %player% nd"]
					format slot 1 of player with 1 of golden apple item named "&6&lGapple" to close then run [make console execute command "requete %arg 1% %player% gp"]
				else:
					send "&cTu as déja demander en duel cette personne, patiente"
			else:
				send "&cCe player est déja en combats" to player

			
			
on command:
	if {duelinstant.%player%} is true:
		if player has permission "commandbypass.pratice":
			send "&cnp"
		else:
			send "&cLes commands sont interdites en duel" to player
			cancel event
	
command /arenacreate <text> <text>:
	permission: arena.pratice
	usage: "&6/arenacreate (nom de l'aréne) (setpos1/setpos2/complete) ou /arenahelp"
	trigger:
		if arg 1 is not set:
			send "&cChoissisez le nom de l'aréne" to player
		else:			
			if arg 2 is "setpos1":
				set {arenapos1.%arg 1%} to location of player
				send "&aTu as set la pos1 de l'aréne" to player
			if arg 2 is "setpos2":
				set {arenapos2.%arg 1%} to location of player
				send "&aTu as set la pos2 de l'aréne" to player
			if arg 2 is "complete":
				add arg 1 to {arenalist::*}
				add 1 to {arenalost}
				set {arena.%arg 1%} to true
				set {arenaname.%arg 1%} to arg 1
				send "&aTu as bien set l'aréne" to player

						
command /arenadelete <text>:
	permission: arena.pratice
	usage: "&6/arenadelete (nom de l'aréne) ou /arenahelp"
	trigger:
		if arg 1 is {arenaname.%arg 1%}:
			send "&aL'aréne a bien était suprimer" to player
			delete {arenaname.%arg 1%}
			delete {arenapos1.%arg 1%}
			delete {arenapos2.%arg 1%}
			remove 1 from {arenalost}	
			remove arg 1 from {arenalist::*}								
			set {arena.%arg 1%} to false
		else:
			send "&c/arenalist pour connaitre les aréne" to player

					

			
command /arenalist:
	permission: arenalist.pratice
	usage: "&6/arenalist ou /arenahelp"
	trigger:
		{arenalost} = 0:
			send "&cIl n'y a aucune aréne disponible" to player
		else:				
			send "&aAréne disponible: %{arenalist::*}%" to player
		
command /requete <player> <player> <text>:
	trigger:
		if arg 3 is "nd":	
			send "&a%arg 2% te demande en duel [No Debuff] /accept %arg 2%" to arg 1
			set {accept.%arg 1%} to true
			set {accept.%arg 2%} to true
			set {modfight.pratice.%arg 1%} to 1
			set {modfight.pratice.%arg 2%} to 1
		if arg 3 is "gp":
			send "&a%arg 2% te demande en duel [Gapple] /accept %arg 2%" to arg 1
			set {accept.%arg 1%} to true
			set {accept.%arg 2%} to true
			set {modfight.pratice.%arg 1%} to 2
			set {modfight.pratice.%arg 2%} to 2

				
command /accept <player>:
	usage: &6/accept <player>
	trigger:
		if {accept.%arg 1%} is true:
			if arg 1 is player:
				send "&cTu n'as pas de demande de duel" to player
			else:
				set {player.%player%} to player
				set {pratice.random} to random integer between 0 and 3
				wait 1 ticks
				if {pratice.random} = 2 or 0:
					teleport player to {arenapos1.ver1}
					teleport arg 1 to {arenapos2.ver1}
					set {duelinstant.%arg 1%} to true
					set {duelinstant.%player%} to true
					{modfight.pratice.%arg 1%} = 1:
						{modfight.pratice.%player%} = 1:
							make console execute command "modnbk %player%" 
							make console execute command "modnbk %arg 1%"
					{modfight.pratice.%arg 1%} = 2:
						{modfight.pratice.%player%} = 2:
							make console execute command "modgp %player%" 
							make console execute command "modgp %arg 1%"
					set {duelinstant.%player%} to true
					{modfight.pratice.%arg 1%} = 1:
						{modfight.pratice.%player%} = 1:
							make console execute command "modnbk %player%" 
							make console execute command "modnbk %arg 1%"
					{modfight.pratice.%arg 1%} = 2:
						{modfight.pratice.%player%} = 2:
							make console execute command "modgp %player%" 
							make console execute command "modgp %arg 1%"
				if {pratice.random} = 1 or 3:
					teleport player to {arenapos1.clay1}
					teleport arg 1 to {arenapos2.clay1}
					set {duelinstant.%arg 1%} to true
					set {duelinstant.%player%} to true
					{modfight.pratice.%arg 1%} = 1:
						{modfight.pratice.%player%} = 1:
							make console execute command "modnbk %player%" 
							make console execute command "modnbk %arg 1%"
					{modfight.pratice.%arg 1%} = 2:
						{modfight.pratice.%player%} = 2:
							make console execute command "modgp %player%" 
							make console execute command "modgp %arg 1%"
					set {duelinstant.%player%} to true
					{modfight.pratice.%arg 1%} = 1:
						{modfight.pratice.%player%} = 1:
							make console execute command "modnbk %player%" 
							make console execute command "modnbk %arg 1%"
					{modfight.pratice.%arg 1%} = 2:
						{modfight.pratice.%player%} = 2:
							make console execute command "modgp %player%" 
							make console execute command "modgp %arg 1%"
		if {accept.%arg 1%} is false:
			send "&cTu n'as pas de demande de duel" to player
			
command /modnbk <player>:
	permission: nb.kit
	trigger:
		clear arg 1' inventory
		set player's hunger bar to 10
		heal player
		set arg 1's hunger to 10
		heal arg 1
		wait 2 ticks
		set chestplate of arg 1 to diamond chestplate of protection 2, unbreaking 3
		wait 1 ticks
		set helmet of arg 1 to diamond helmet of protection 2, unbreaking 3
		wait 1 ticks
		set leggings of arg 1 to diamond leggings of protection 2, unbreaking 3
		wait 1 ticks
		set boots of arg 1 to diamond boots of protection 2, unbreaking 3
		wait 1 ticks
		set slot 2 of arg 1 to 16 ender pearl
		wait 2 ticks
		set slot 0 of arg 1 to diamond sword of sharpness 3, unbreaking 3
		set slot 1 of arg 1 to 64 carrots item
		set slot 2 of arg 1 to 16 ender pearl
		set slot 3 of arg 1 to potion of:8259
		set slot 4 of arg 1 to potion of:8226
		set slot 5 of arg 1 to potion of:16421
		set slot 6 of arg 1 to potion of:16421
		set slot 7 of arg 1 to potion of:16421
		set slot 8 of arg 1 to potion of:16421
		set slot 9 of arg 1 to potion of:16421
		set slot 10 of arg 1 to potion of:16421
		set slot 11 of arg 1 to potion of:16421
		set slot 12 of arg 1 to potion of:16421
		set slot 13 of arg 1 to potion of:16421
		set slot 14 of arg 1 to potion of:16421
		set slot 15 of arg 1 to potion of:16421
		set slot 16 of arg 1 to potion of:16421
		set slot 17 of arg 1 to potion of:8226
		set slot 18 of arg 1 to potion of:16421
		set slot 19 of arg 1 to potion of:16421
		set slot 20 of arg 1 to potion of:16421
		set slot 21 of arg 1 to potion of:16421
		set slot 22 of arg 1 to potion of:16421
		set slot 23 of arg 1 to potion of:16421
		set slot 24 of arg 1 to potion of:16421
		set slot 25 of arg 1 to potion of:16421
		set slot 26 of arg 1 to potion of:8226
		set slot 27 of arg 1 to potion of:16421
		set slot 28 of arg 1 to potion of:16421
		set slot 29 of arg 1 to potion of:16421
		set slot 30 of arg 1 to potion of:16421
		set slot 31 of arg 1 to potion of:16421
		set slot 32 of arg 1 to potion of:16421
		set slot 33 of arg 1 to potion of:16421
		set slot 34 of arg 1 to potion of:16421
		set slot 35 of arg 1 to potion of:8226
		
command /modgp <player>:
	permission: gb.kit
	trigger:
		clear arg 1' inventory
		set player's hunger bar to 10
		heal player
		set arg 1's hunger to 10
		heal arg 1
		wait 2 ticks
		set chestplate of arg 1 to diamond chestplate of protection 4, unbreaking 3
		wait 1 ticks
		set helmet of arg 1 to diamond helmet of protection 4, unbreaking 3
		wait 1 ticks
		set leggings of arg 1 to diamond leggings of protection 4, unbreaking 3
		wait 1 ticks
		set boots of arg 1 to diamond boots of protection 4, unbreaking 3
		wait 1 ticks
		set slot 2 of arg 1 to 64 Enchanted Golden Apple
		
		

		
command /vls:
	permission: vlc.pratice
	trigger:
		if {duelinstant.%player%} is true:
			send "&cvls on" to player
		if {duelinstant.%player%} is false:
			send "&avls off"
	
	
	
command /exitd <player>:
	permission: exited.practice
	trigger:
		set {duelinstant.%arg 1%} to false
		teleport arg 1 to {spawn.pratice}
		send "&c&lLeave fight" to arg 1
	
on death:
	teleport player to {spawn.pratice}
	if {duelinstant.%player%} is true:	
		set {duelinstant.%player%} to false
		set {duelinstant.%attacker%} to false
		set {dueltemp.%player%} to false
		set {dueltemp.%attacker%} to false
		set {accept.%victim%} to false
		set {accept.%attacker%} to false
		if attacker is player:
			send "&cTu as perdu" to player
		else:
			send "&aTu as gagner contre %victim%" to attacker
			send "&cTu as perdu contre %attacker%" to victim
		clear drops
		wait 3 seconds
		clear attacker's inventory
		clear victim's inventory
		force victim to respawn
		teleport player to {spawn.pratice}
		set {death.%player%} to location of player
		teleport attacker to {spawn.pratice}

on death of a player:
	set death message to ""
	execute console command "/effect %player% clear"
	if {duelinstant.%player%} is false:	
		if player is in world "ver1":
			teleport player to {spawn.pratice}
		if player is in world "clay1":
			teleport player to {spawn.pratice}
		if player is in world "test":
			teleport player to {spawn.pratice}
	
On quit:
	set {online.%offline player%} to false
	set {loc.%player%} to location of player


		
	
on break:
	if player don't have permission "build.pratice":
		cancel event

		
on hunger meter change:
	if {duelinstant.%player%} is false:	
		set player's hunger bar to 10
		
every 1 seconds:
	loop all players:
		if {online.%loop-player%} is false:
			spawn a zombie at {loc.%loop-player%}
			set name of spawned entity to "&a%loop-player%"
		
	


command /testt <player>:
	trigger:
		set {pratice.random} to random integer between 0 and 3
		wait 1 ticks
		send "&a%{pratice.random}%" to player
		
		

command /duelset <player>:
	permission: duelset.pratice
	trigger:
		set {duelinstant.%arg 1%} to true
		send "&agood" to arg 1

		
	

 

Partager ce message


Lien à poster
Partager sur d’autres sites

Quand le joueur accepte la demande de duel, rajoute une variable où il est stocké le pseudo de son adversaire, par exemple

set {dueladversaire.%player%} to arg-1
set {dueladversaire.%arg-1%} to player


Si un des deux joueurs se déconnecte en duel, tu peux récupérer le nom de son adversaire en faisant

on disconnect:
	if {dueladversaire.%player%} is set:
		#ton code sachant que {dueladversaire.%player%} correspond à l'adversaire du joueur qui s'est déco

et après tu delete la variable 

PS: j'ai pas lu tout ton code, donc je dis peut être n'importe quoi :s

Modifié par Lemrigue

Partager ce message


Lien à poster
Partager sur d’autres sites

Ahhh je n'i avais pas pensais bien vu j'essaye sa tout de suite je te redis et je set les 2 variable ou q'une ?

Modifié par ThzCrapy

Partager ce message


Lien à poster
Partager sur d’autres sites

Parfait sa marche nickel j'ai vraiment chercher trop loin, merci infiniment  je ne sais plus comment passer en résolu sa fais un petit moment que je n'était pas sur le site :c

Partager ce message


Lien à poster
Partager sur d’autres sites
Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.

×

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.