Aller au contenu

Question

Posté(e)

Version de Minecraft : 1.12.2
Version de Skript : 2.2.2

Addons utilisés: WildSkript 1.12, TuSKe, SkWaze,SKQuery,Skellett

Type du skript : Achat de Porte

Description du script :

Bonjour, j'avais un skript qui fonctionné en 1.7.10 que j'aimerais passé en 1.12.2, qui fonctionne avec la couleurs d'une laine posé sous un porte pour différencié les prix voici la base:

 

#=============================Options==========================================================================#

options:
	PermMSG: &4Vous n'avez pas la permission ! #'Message permission
	Prefix: &6[&8NeoHouse&6] # Prefix des message
aliases:
	cle = 262
	wool1 = 35:0
	wool2 = 35:8
	wool3 = 35:7
	

on left click on a wooden door:
	loop blocks in radius 2 around targeted block:
		if loop-block is a wooden door:
			if player is not sneaking:
				if {lock::%location of targeted block%} is not set:
					if {lock::%location of block above targeted block%} is not set:
						if {lock::%location of block below targeted block%} is not set:
							cancel event
							open chest with 1 rows named "&c&lNoelife &f&lHouses" to player
							wait 1 tick
							loop blocks in radius 5 around targeted block:
								if loop-block-2 is a wool1:
									if player's money is greater or equal to 20000:
										format slot 4 of player with an 160:5 named "&a&lAcheter" with lore "||&3&oAchetable: &a&lOUI||||&7&m----------------------||&3&oPrix de la maison: &220.000$||&7&m----------------------" to close then run [make player execute command "/lock"]
									else:
										format slot 4 of player with an green stained glass named "&a&lAcheter" with lore "||&3&oAchetable: &4&lNON||&7&m----------------------||&3&oPrix de la maison: &210.000$||&7&m----------------------" to close then run [make player execute command "/lock"]
										format slot 0 of player with skull of {_player} named "&cOwner: &cS&6a&em&a1&b3&97&10" to be unstealable
										format slot 3 of player with a black stained glass named "&cClose" to close
										format slot 0 of player with a black stained glass named "&cClose" to close
										format slot 1 of player with a black stained glass named "&cClose" to close
										format slot 2 of player with a black stained glass named "&cClose" to close
										format slot 6 of player with a black stained glass named "&cClose" to close
										format slot 7 of player with a black stained glass named "&cClose" to close
										format slot 8 of player with a black stained glass named "&cClose" to close
										format slot 8 of player with a black stained glass named "&cClose" to close
								if loop-block-2 is a wool2:
									if player's money is greater or equal to 100000:
										format slot 4 of player with an green stained glass named "&a&lAcheter" with lore "||&3&oAchetable: &a&lOUI||||&7&m----------------------||&3&oPrix de la maison: &2100.000$||&7&m----------------------" to close then run [make player execute command "/lock"]
									else:
										format slot 4 of player with an green stained glass named "&a&lAcheter" with lore "||&3&oAchetable: &4&lNON||&7&m----------------------||&3&oPrix de la maison: &2100.000$||&7&m----------------------" to close then run [make player execute command "/lock"]
										format slot 5 of player with a black stained glass named "&cClose" to close
										format slot 3 of player with a black stained glass named "&cClose" to close
										format slot 0 of player with a black stained glass named "&cClose" to close
										format slot 1 of player with a black stained glass named "&cClose" to close
										format slot 2 of player with a black stained glass named "&cClose" to close
										format slot 6 of player with a black stained glass named "&cClose" to close
										format slot 7 of player with a black stained glass named "&cClose" to close
										format slot 8 of player with a black stained glass named "&cClose" to close
										format slot 8 of player with a black stained glass named "&cClose" to close
								if loop-block-2 is a wool3:
									if player's money is greater or equal to 250000:
										format slot 4 of player with an green stained glass named "&a&lAcheter" with lore "||&3&oAchetable: &a&lOUI||||&7&m----------------------||&3&oPrix de la maison: &2250.000$||&7&m----------------------" to close then run [make player execute command "/lock"]
									else:
										format slot 4 of player with an green stained glass named "&a&lAcheter" with lore "||&3&oAchetable: &4&lNON||&7&m----------------------||&3&oPrix de la maison: &2250.000$||&7&m----------------------" to close then run [make player execute command "/lock"]
										format slot 5 of player with a black stained glass named "&cClose" to close
										format slot 3 of player with a black stained glass named "&cClose" to close
										format slot 0 of player with a black stained glass named "&cClose" to close
										format slot 1 of player with a black stained glass named "&cClose" to close
										format slot 2 of player with a black stained glass named "&cClose" to close
										format slot 6 of player with a black stained glass named "&cClose" to close
										format slot 7 of player with a black stained glass named "&cClose" to close
										format slot 8 of player with a black stained glass named "&cClose" to close
										format slot 8 of player with a black stained glass named "&cClose" to close
				else:
					if {lock::%location of targeted block%} is not "%player%":
						if {lock::%location of block above targeted block%} is not "%player%":
							if {lock::%location of block below targeted block%} is not "%player%":
								cancel event
								send "{@Prefix} &4Cette Maison est déjà Acheté !"
								stop
				if {lock::%location of targeted block%} is "%player%":
					if {lock::%location of block above targeted block%} is "%player%":
						if {lock::%location of block below targeted block%} is "%player%":
							cancel event
							open chest with 1 rows named "&c&lNoelife &f&lHouses" to player
							wait 1 tick
							format slot 4 of player with an green stained glass named "&c&lVendre" with lore "||&7&m----------------------||&3&oPrix de la vente: &2250.000$||&7&m----------------------" to close then run [make player execute command "/vendre"]
							format slot 5 of player with a black stained glass named "&cClose" to close
							format slot 3 of player with a black stained glass named "&cClose" to close
							format slot 0 of player with a black stained glass named "&cClose" to close
							format slot 1 of player with a black stained glass named "&cClose" to close
							format slot 2 of player with a black stained glass named "&cClose" to close
							format slot 6 of player with a black stained glass named "&cClose" to close
							format slot 7 of player with a black stained glass named "&cClose" to close
							format slot 8 of player with a black stained glass named "&cClose" to close
							format slot 8 of player with a black stained glass named "&cClose" to close
command /lock:
	trigger:
		if targeted block is a wooden door:
			if {lock::%location of targeted block%} is not set:
				if {lock::%location of block above targeted block%} is not set:
					if {lock::%location of block below targeted block%} is not set:
						loop blocks in radius 5 around targeted block:
							if loop-block is a wool1:
								if player's money is greater or equal to 20000:
									set {_loc} to location of targeted block
									set {_loc.1} to location of block above targeted block
									set {_loc.2} to location of block Below targeted block
									set {lock::%location of block above targeted block%} to "%player%"
									set {lock::%location of block below targeted block%} to "%player%"
									set {lock::%location of targeted block%} to "%player%"
									make console execute command "/eco take %player% 20000"
									send "{@Prefix} &aVous venez d'acheter cette Maison !"
									give player a cle named "&6Clé" with lore "&7&m----------------------||&k%{_loc}%||&k%{_loc.1}%||&k%{_loc.2}%||&7&m----------------------"
							if loop-block is a wool2:
								if player's money is greater or equal to 100000:
									set {_loc} to location of targeted block
									set {_loc.1} to location of block above targeted block
									set {_loc.2} to location of block Below targeted block
									set {lock::%location of block above targeted block%} to "%player%"
									set {lock::%location of block below targeted block%} to "%player%"
									set {lock::%location of targeted block%} to "%player%"
									make console execute command "/eco take %player% 100000"
									send "{@Prefix} &aVous venez d'acheter cette Maison !"
									give player a cle named "&6Clé" with lore "&7&m----------------------||&k%{_loc}%||&k%{_loc.1}%||&k%{_loc.2}%||&7&m----------------------"
							if loop-block is a wool3:
								if player's money is greater or equal to 250000:
									set {_loc} to location of targeted block
									set {_loc.1} to location of block above targeted block
									set {_loc.2} to location of block Below targeted block
									set {lock::%location of block above targeted block%} to "%player%"
									set {lock::%location of block below targeted block%} to "%player%"
									set {lock::%location of targeted block%} to "%player%"
									make console execute command "/eco take %player% 250000"
									send "{@Prefix} &aVous venez d'acheter cette Maison !"
									give player a cle named "&6Clé" with lore "&7&m----------------------||&k%{_loc}%||&k%{_loc.1}%||&k%{_loc.2}%||&7&m----------------------"
			else:
				send "{@Prefix} &4Cette Maison est déjà Acheté."
				stop
			
command /vendre:
	trigger:
		if targeted block is a wooden door:
			if {lock::%location of targeted block%} is "%player%":
				if {lock::%location of block above targeted block%} is "%player%":
					if {lock::%location of block below targeted block%} is "%player%":
						set {_loc} to location of targeted block
						set {_loc.1} to location of block above targeted block
						set {_loc.2} to location of block Below targeted block
						loop all items in player's inventory:
							if loop-item is cle named "&6Clé" with lore "&7&m----------------------||&k%{_loc}%||&k%{_loc.1}%||&k%{_loc.2}%||&7&m----------------------":
								remove loop-item from player
								delete {lock::%location of block above targeted block%}
								delete {lock::%location of block below targeted block%}
								delete {lock::%location of targeted block%}
								remove {lock::%location of targeted block%} from player
								loop blocks in radius 5 around targeted block:
									if loop-block is a wool1:
										make console execute command "/eco give %player% 10000"
										send "{@Prefix} &4Vous avez Vendu votre Maison."
										stop
									if loop-block is a wool2:
										make console execute command "/eco give %player% 50000"
										send "{@Prefix} &4Vous avez Vendu votre Maison."
										stop
									if loop-block is a wool3:
										make console execute command "/eco give %player% 125000"
										send "{@Prefix} &4Vous avez Vendu votre Maison."
										stop
on left click on a wooden door:
	if player is sneaking:
		if player has permission "lock.admin":
			delete {lock::%location of block above targeted block%}
			delete {lock::%location of block below targeted block%}
			delete {lock::%location of targeted block%}
			set targeted block to air
			send "{@Prefix} &4Vous avez Cassé cette Porte !"
		else:
			send "{@Prefix} &4Vous n'avez pas la Permission pour Casser cette Porte !"
on rightclick on a wooden door with a cle:
	loop blocks in radius 2 around targeted block:
		if loop-block is a wooden door:
			if name of player's tool contains "&6Clé":
				if lore of player's tool contains "%location of target block%":
					stop
				else:
					cancel event
					send "{@Prefix} &4Ce n'est pas la Bonne Clé pour cette Porte !"
					stop
on rightclick on a wooden door:
	if player is not holding a cle:
		if {lock::%location of targeted block%} is not set:
			if {lock::%location of block above targeted block%} is not set:
				if {lock::%location of block below targeted block%} is not set:
					cancel event
					send "{@Prefix} &aCette Maison est Libre, clique Gauche pour l'Acheter."
		else:
			cancel event
			send "{@Prefix} &4Cette Porte est Fermé, utilise tes Clés pour l'ouvrir !"

 

5 réponses à cette question

Messages recommandés

  • 0
Posté(e) (modifié)

Bonjour/Bonsoir,

pour ton problème de skript il est très simple de 1 faut que tu prenne la 2.4.1 je te mets le lien vers le github de skript ensuite pour les portes il faut faire ceci pour connaître le nom de la porte :

on right click:
    send "%clicked block%"

ensuite tu pourra avoir le nom de ta porte par exemple : left-hinged closed top oak wood door, d'ailleurs petit détails pour que tu puisse faire clique droit sur le bas de la porte faut que tu fasse la même chose

d'ailleurs je vais te donner la liste de mes addons car il se peut que tu en ait qu'il ne soit pas à jour ou qui peuvent te servir au plus tard

je t'explique comment l'utiliser :

- genre left-hinged c'est la position de ta porte sois à gauche sois à droite

- ensuite le top sais la position et cela peut varier en fonction genre du type : closed northward bottom oak wood door

 

Liste d'addons :

- Skelett-Legacy

- SkBee

- SkQuery 4

- SkRayFall

- SkStuff

- Skutilities

- Tuske

- WildSkript

- MundoSK

- SkDragon

- WolvSK

d'ailleurs si tu utilise SkQuery pour faire tes gui change tout de suite pour Tuske qui est moins buggé car SkQuery à été abandonné par son créateur et n'a plus de maj contrairement à Tuske

si tu à besoin de plus de détails contact moi sur discord : Hakray#6434

Modifié par HakrayIII
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.