Aller au contenu

Question

Posté(e)

Version de Minecraft : 1.8
Version de Skript : 2.2

Description du script :

Bonjour, j'aimerais rajouter une durabilité à mon unclaim finder de 1000. J'ai fais plusieurs tests de mon coté sans succès si quelqu'un pourrais m'aider sa serais super ! 🙂 

Voici le code

Citation

aliases:
    UNCLAIMFINDER= 347
    NOUNCLAIMFINDER= 38:1

on right click with UNCLAIMFINDER:
    if name of tool of player is "&c&lUnclaimFinder &6(&e1000&e/1000&6)":
                loop blocks within chunk at player:
                    if loop-block is a chest:
                        add 1 to {_chest}
                    if loop-block is an ender chest:
                        add 1 to {_chest}
                    if loop-block is a trapped chest:
                        add 1 to {_chest}
                    if loop-block is a dispenser:
                        add 1 to {_chest}
                    if loop-block is hopper:
                        add 1 to {_chest}
                    if loop-block is Dropper:
                        add 1 to {_chest}
                    if loop-block is Minecart with hopper:
                        add 1 to {_chest}
                    if loop-block is Minecart with chest:
                        add 1 to {_chest}
                wait 1 tick
                send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk"

on command "/uf":
    if player has permission "uf.give":
        cancel event
        give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
        send "Voici un unclaim finder"

 

9 réponses à cette question

Messages recommandés

  • 0
Posté(e) (modifié)

Ceci devrait fonctionner :

aliases:
    UNCLAIMFINDER= 347
    NOUNCLAIMFINDER= 38:1

on right click with UNCLAIMFINDER:
	if name of player's tool contains "&c&lUnclaimFinder":
		loop blocks within chunk at player:
			if loop-block is chest or ender chest or trapped chest or dispenser or hopper or dropper or minecart with hopper or minecart with chest:
				add 1 to {_chest}
		send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk."
		set {_b} to name of player's tool
		replace all "&c&lUnclaimFinder &6(" and "&e/1000&6)" with "" in {_b}
		set uncolored {_b} to {_b} parsed as number
		if {_b}-1 = 0:
			remove UNCLAIMFINDER from player's inventory
			send "&cVotre unclaimfinder est cassé."
		else:
			set name of player's tool to "&c&lUnclaimFinder &6(&e%{_b}%&e/1000&6)"
			
on command "/uf":
	if player has permission "uf.give":
		cancel event
		give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
		send "Voici un unclaim finder"

 

Modifié par Lou'
  • J'aime 1
  • 0
Posté(e)
Il y a 8 heures, Lou' a dit :

Ceci devrait fonctionner :


aliases:
    UNCLAIMFINDER= 347
    NOUNCLAIMFINDER= 38:1

on right click with UNCLAIMFINDER:
	if name of player's tool contains "&c&lUnclaimFinder":
		loop blocks within chunk at player:
			if loop-block is chest or ender chest or trapped chest or dispenser or hopper or dropper or minecart with hopper or minecart with chest:
				add 1 to {_chest}
		send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk."
		set {_b} to name of player's tool
		replace all "&c&lUnclaimFinder &6(" and "&e/1000&6)" with "" in {_b}
		set uncolored {_b} to {_b} parsed as number
		if {_b}-1 = 0:
			remove UNCLAIMFINDER from player's inventory
			send "&cVotre unclaimfinder est cassé."
		else:
			set name of player's tool to "&c&lUnclaimFinder &6(&e%{_b}%&e/1000&6)"
			
on command "/uf":
	if player has permission "uf.give":
		cancel event
		give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
		send "Voici un unclaim finder"

 

La durabilité ne fonctionne toujours pas ... 

Voilà l'erreur console :

uncoloured {_b} can't be set to anything (uf.sk, line 13: set uncolored {_b} to {_b} parsed as number')

  • 0
Posté(e)

J'ai dit que ça devrait fonctionner. Ne dit surtout pas merci pour avoir essayer de t'aider.
Je ne sais pas si tu te rends compte, mais j'ai écrit ce code sans le tester juste comme ça, avoir une seule erreur, je trouve ça plutôt bien.
Là, ça marchera :

aliases:
    UNCLAIMFINDER= 347
    NOUNCLAIMFINDER= 38:1

on right click with UNCLAIMFINDER:
	if name of player's tool contains "&c&lUnclaimFinder":
		loop blocks within chunk at player:
			if loop-block is chest or ender chest or trapped chest or dispenser or hopper or dropper or minecart with hopper or minecart with chest:
				add 1 to {_chest}
		send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk."
		set {_b} to name of player's tool
		replace all "&c&lUnclaimFinder &6(" and "&e/1000&6)" with "" in {_b}
		set {_b} to {_b} parsed as number
		if {_b}-1 = 0:
			remove UNCLAIMFINDER from player's inventory
			send "&cVotre unclaimfinder est cassé."
		else:
			set name of player's tool to "&c&lUnclaimFinder &6(&e%{_b}%&e/1000&6)"
			
on command "/uf":
	if player has permission "uf.give":
		cancel event
		give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
		send "Voici un unclaim finder"

 

  • 0
Posté(e)
il y a 43 minutes, Lou' a dit :

J'ai dit que ça devrait fonctionner. Ne dit surtout pas merci pour avoir essayer de t'aider.
Je ne sais pas si tu te rends compte, mais j'ai écrit ce code sans le tester juste comme ça, avoir une seule erreur, je trouve ça plutôt bien.
Là, ça marchera :


aliases:
    UNCLAIMFINDER= 347
    NOUNCLAIMFINDER= 38:1

on right click with UNCLAIMFINDER:
	if name of player's tool contains "&c&lUnclaimFinder":
		loop blocks within chunk at player:
			if loop-block is chest or ender chest or trapped chest or dispenser or hopper or dropper or minecart with hopper or minecart with chest:
				add 1 to {_chest}
		send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk."
		set {_b} to name of player's tool
		replace all "&c&lUnclaimFinder &6(" and "&e/1000&6)" with "" in {_b}
		set {_b} to {_b} parsed as number
		if {_b}-1 = 0:
			remove UNCLAIMFINDER from player's inventory
			send "&cVotre unclaimfinder est cassé."
		else:
			set name of player's tool to "&c&lUnclaimFinder &6(&e%{_b}%&e/1000&6)"
			
on command "/uf":
	if player has permission "uf.give":
		cancel event
		give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
		send "Voici un unclaim finder"

 

oh je ne dis pas le contraire, je voulais pas etre désagréable, je m'en excuse c'étais d'une bonne intention 😞 

 

  • 0
Posté(e)
il y a 51 minutes, Lou' a dit :

J'ai dit que ça devrait fonctionner. Ne dit surtout pas merci pour avoir essayer de t'aider.
Je ne sais pas si tu te rends compte, mais j'ai écrit ce code sans le tester juste comme ça, avoir une seule erreur, je trouve ça plutôt bien.
Là, ça marchera :


aliases:
    UNCLAIMFINDER= 347
    NOUNCLAIMFINDER= 38:1

on right click with UNCLAIMFINDER:
	if name of player's tool contains "&c&lUnclaimFinder":
		loop blocks within chunk at player:
			if loop-block is chest or ender chest or trapped chest or dispenser or hopper or dropper or minecart with hopper or minecart with chest:
				add 1 to {_chest}
		send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk."
		set {_b} to name of player's tool
		replace all "&c&lUnclaimFinder &6(" and "&e/1000&6)" with "" in {_b}
		set {_b} to {_b} parsed as number
		if {_b}-1 = 0:
			remove UNCLAIMFINDER from player's inventory
			send "&cVotre unclaimfinder est cassé."
		else:
			set name of player's tool to "&c&lUnclaimFinder &6(&e%{_b}%&e/1000&6)"
			
on command "/uf":
	if player has permission "uf.give":
		cancel event
		give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
		send "Voici un unclaim finder"

 

Du coup merci c'est good y a plus d'erreur, mais sur l'item ou c'est écrit 1000/1000 cela ne baisse pas pour la durabilité c'est normal ? ^^

  • 0
Posté(e)

Ah oui, comme un sagouini j'ai zappé de rajouter un petit calcul, j'ai voulu finir trop vite :

aliases:
    UNCLAIMFINDER= 347
    NOUNCLAIMFINDER= 38:1

on right click with UNCLAIMFINDER:
	if name of player's tool contains "&c&lUnclaimFinder":
		loop blocks within chunk at player:
			if loop-block is chest or ender chest or trapped chest or dispenser or hopper or dropper or minecart with hopper or minecart with chest:
				add 1 to {_chest}
		send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk."
		set {_b} to name of player's tool
		replace all "&c&lUnclaimFinder &6(" and "&e/1000&6)" with "" in {_b}
		set {_b} to {_b} parsed as number
		remove 1 from {_b}
		if {_b} = 0:
			remove UNCLAIMFINDER from player's inventory
			send "&cVotre unclaimfinder est cassé."
		else:
			set name of player's tool to "&c&lUnclaimFinder &6(&e%{_b}%&e/1000&6)"
			
on command "/uf":
	if player has permission "uf.give":
		cancel event
		give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
		send "Voici un unclaim finder"

 

  • J'aime 1
  • 0
Posté(e)
Il y a 6 heures, Lou' a dit :

Ah oui, comme un sagouini j'ai zappé de rajouter un petit calcul, j'ai voulu finir trop vite :


aliases:
    UNCLAIMFINDER= 347
    NOUNCLAIMFINDER= 38:1

on right click with UNCLAIMFINDER:
	if name of player's tool contains "&c&lUnclaimFinder":
		loop blocks within chunk at player:
			if loop-block is chest or ender chest or trapped chest or dispenser or hopper or dropper or minecart with hopper or minecart with chest:
				add 1 to {_chest}
		send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk."
		set {_b} to name of player's tool
		replace all "&c&lUnclaimFinder &6(" and "&e/1000&6)" with "" in {_b}
		set {_b} to {_b} parsed as number
		remove 1 from {_b}
		if {_b} = 0:
			remove UNCLAIMFINDER from player's inventory
			send "&cVotre unclaimfinder est cassé."
		else:
			set name of player's tool to "&c&lUnclaimFinder &6(&e%{_b}%&e/1000&6)"
			
on command "/uf":
	if player has permission "uf.give":
		cancel event
		give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
		send "Voici un unclaim finder"

 

Merci de ta réponse, cela fait exactement pareil le 1000/1000 quand je clique ne descend pas sa bouge pas. Pourtant comme avant je n'est aucune erreur console c'est étrange.. je sais pas si tu peux savoir pourquoi ?

  • 0
Posté(e) (modifié)

Yep en effet, un problème de couleur. C'est réglé, cette fois j'ai testé sur mon serveur, j'ai donc dû adapter le code pour la 1.15.2 mais tu ne devrais pas avoir de soucis en 1.8

on right click with clock:
	if name of player's tool contains "&c&lUnclaimFinder":
		set {_chest} to 0
		loop blocks within chunk at player:
			if loop-block is chest or ender chest or trapped chest or dispenser or hopper or dropper or minecart with hopper or minecart with chest:
				add 1 to {_chest}
		send "&b%{_chest}% coffre(s) &7ont été trouvés sur ce chunk."
		set {_b} to uncolored name of player's tool
		replace all "UnclaimFinder (" and "/1000)" with "" in {_b}
		set {_b} to {_b} parsed as number
		remove 1 from {_b}
		if {_b} = 0:
			remove clock named "&c&lUnclaimFinder &6(&e1&e/1000&6)" from player's inventory
			send "&cVotre unclaimfinder est cassé."
		else:
			set name of player's tool to "&c&lUnclaimFinder &6(&e%{_b}%&e/1000&6)"

on command "/uf":
	if player has permission "uf.give":
		cancel event
		give player clock named "&c&lUnclaimFinder &6(&e1000&e/1000&6)"
		send "Voici un unclaim finder"

Si ça marche, je t'invite à passer ton sujet en résolu.

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