Skocz do zawartości
  • 0

Naprawianie za Walute


shamiyami

Pytanie

Dzien dobry, 

czy jest skrypt na naprawienie czegos komenda/tabliczka za itemy? Chodzi o to, ze chcialbym miec walute serwerowa (Nie chodzi o $ czy tam essentials economy). Tylko, ze bedzie itemek, np. stone nazwany "Waluta Serwerowa". I jesli ma sie dana ilosc tego itemku, mozna naprawic jakas rzecz i wtedy zabiera dana ilosc tej waluty i naprawia rzecz.

Odnośnik do komentarza
https://skript.pl/temat/32791-naprawianie-za-walute/
Udostępnij na innych stronach

9 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Takie coś na szybko

 

command /napraw:
	trigger:
		if player's tool is any tool or any armor or any weapon or shield:
			if durability of player's tool is not 0:
				if {Waluta::%player%} >= 100:
					remove 100 from {Waluta::%player%}
					repair player's tool
					send "&aNaprawiono. Pobrano 100 waluty z konta"
				else:
					send "&cMasz za malo waluty"
			else:
				send "&cPrzedmiot nie jest zniszczony."
		else:
			send "&cNie mozesz naprawic tego przedmiotu"
on join:
	if {Waluta::%player%} is not set:
		set {Waluta::%player%} to 0
command /waluta [<text>]:
	trigger:
		if arg is not set:
			send "&6Waluta: &c%{Waluta::%player%}%"
on sign change:
	if line 1 is "[Napraw]":
		if line 2 is "hand" or "all":
			set line 1 to "&9[Napraw]"
			set line 2 to "&2%line 2%"
on rightclick:
	if event-block is sign:
		if line 1 of event-block is "&9[Napraw]":
			if line 2 of event-block is "&2hand":
				if player's tool is any tool or any armor or any weapon or shield or fishing rod:
					if durability of player's tool is not 0:
						if {Waluta::%player%} >= 100:
							remove 100 from {Waluta::%player%}
							repair player's tool
							send "&aNaprawiono. Pobrano 100 waluty z konta"
						else:
							send "&cMasz za malo waluty"
					else:
						send "&cPrzedmiot nie jest zniszczony."
				else:
					send "&cNie mozesz naprawic tego przedmiotu"
			else if line 2 of event-block is "&2all":
				if {Waluta::%player%} >= 100:
					set {_ni} to 0
					loop items in player's inventory:
						if loop-item is any tool or any armor or any weapon or shield or fishing rod:
							if durability of loop-item is not 0:
								repair loop-item
								add 1 to {_ni}
					if {_ni} > 0:
						remove 100 from {Waluta::%player%}
						send "&aNaprawiono. Pobrano 100 waluty z konta"
					else:
						send "&cBrak przedmiotow do naprawy."
				else:
					send "&cMasz za malo waluty"

 

Odnośnik do komentarza
https://skript.pl/temat/32791-naprawianie-za-walute/#findComment-212940
Udostępnij na innych stronach

  • 0

Chodzilo mi bardziej, by waluta byla w formie itemku w eq. Np. mam 64 sniezki nazwane "Waluta". I by naprawic jakis miecz czy cos, potrzebne jest 10 sniezek nazwanych "Waluta". I po naprawieniu zabieralo te 10 sniezek. I zeby sie to nie psulo i gracz nie mogl zaplacic zwklymi sniezkami, czyli takimi bez tej nazwy np. "Waluta".

 

Odnośnik do komentarza
https://skript.pl/temat/32791-naprawianie-za-walute/#findComment-212942
Udostępnij na innych stronach

  • 0
command /napraw:
	trigger:
		if player's tool is any tool or any armor or any weapon or shield:
			if durability of player's tool is not 0:
				if player has 10 snowballs named "&6Waluta serwerowa":
					remove 10 snowballs named "&6Waluta serwerowa" from player
					repair player's tool
					send "&aNaprawiono. Pobrano 10 waluty serwerowej"
				else:
					send "&cMasz za malo waluty"
			else:
				send "&cPrzedmiot nie jest zniszczony."
		else:
			send "&cNie mozesz naprawic tego przedmiotu"
on sign change:
	if line 1 is "[Napraw]":
		if line 2 is "hand" or "all":
			set line 1 to "&9[Napraw]"
			set line 2 to "&2%line 2%"
on rightclick:
	if event-block is sign:
		if line 1 of event-block is "&9[Napraw]":
			if line 2 of event-block is "&2hand":
				if player's tool is any tool or any armor or any weapon or shield or fishing rod:
					if durability of player's tool is not 0:
						if player has 10 snowballs named "&6Waluta serwerowa":
							remove 10 snowballs named "&6Waluta serwerowa" from player
							repair player's tool
							send "&aNaprawiono. Pobrano 10 waluty serwerowej"
						else:
							send "&cMasz za malo waluty"
					else:
						send "&cPrzedmiot nie jest zniszczony."
				else:
					send "&cNie mozesz naprawic tego przedmiotu"
			else if line 2 of event-block is "&2all":
				if player has 10 snowballs named "&6Waluta serwerowa":
					set {_ni} to 0
					loop items in player's inventory:
						if loop-item is any tool or any armor or any weapon or shield or fishing rod:
							if durability of loop-item is not 0:
								repair loop-item
								add 1 to {_ni}
					if {_ni} > 0:
						remove 10 snowballs named "&6Waluta serwerowa" from player
						send "&aNaprawiono. Pobrano 10 waluty serwerowej"
					else:
						send "&cBrak przedmiotow do naprawy."
				else:
					send "&cMasz za malo waluty"
command /waluta:
	trigger:
		add 10 snowballs named "&6Waluta serwerowa" to player

 

Odnośnik do komentarza
https://skript.pl/temat/32791-naprawianie-za-walute/#findComment-212944
Udostępnij na innych stronach

  • 0

Mozna by prosic jeszcze o naprawienie tego?

Cytat

 

[18:36:20 ERROR]: 'player's tool is any tool or any armor or any weapon or shield' is not a boolean (yes/no) (text.sk, line 3: if player's tool is any tool or any armor or any weapon or shield:')

[18:36:20 ERROR]: 'else' has to be placed just after an 'if' or 'else if' section (text.sk, line 13: else:')

[18:36:20 ERROR]: 'player's tool is any tool or any armor or any weapon or shield or fishing rod' is not a boolean (yes/no) (text.sk, line 24: if player's tool is any tool or any armor or any weapon or shield or fishing rod:')

[18:36:20 ERROR]: 'else' has to be placed just after an 'if' or 'else if' section (text.sk, line 34: else:')

[18:36:20 ERROR]: There's no loop that matches 'loop-item is any tool or any armor or any weapon or shield or fishing rod' (text.sk, line 40: if loop-item is any tool or any armor or any weapon or shield or fishing rod:')

 

 

Odnośnik do komentarza
https://skript.pl/temat/32791-naprawianie-za-walute/#findComment-212950
Udostępnij na innych stronach

  • 0
Spoiler

command /napraw:
	trigger:
		if player's tool is any tool or any armor or any weapon or fishing rod:
			if durability of player's tool is not 0:
				if player has 10 snowballs named "&6Waluta serwerowa":
					remove 10 snowballs named "&6Waluta serwerowa" from player
					repair player's tool
					send "&aNaprawiono. Pobrano 10 waluty serwerowej"
				else:
					send "&cMasz za malo waluty"
			else:
				send "&cPrzedmiot nie jest zniszczony."
		else:
			send "&cNie mozesz naprawic tego przedmiotu"
on sign change:
	if line 1 is "[Napraw]":
		if line 2 is "hand" or "all":
			set line 1 to "&9[Napraw]"
			set line 2 to "&2%line 2%"
on rightclick:
	if event-block is sign:
		if line 1 of event-block is "&9[Napraw]":
			if line 2 of event-block is "&2hand":
				if player's tool is any tool or any armor or any weapon or fishing rod:
					if durability of player's tool is not 0:
						if player has 10 snowballs named "&6Waluta serwerowa":
							remove 10 snowballs named "&6Waluta serwerowa" from player
							repair player's tool
							send "&aNaprawiono. Pobrano 10 waluty serwerowej"
						else:
							send "&cMasz za malo waluty"
					else:
						send "&cPrzedmiot nie jest zniszczony."
				else:
					send "&cNie mozesz naprawic tego przedmiotu"
			else if line 2 of event-block is "&2all":
				if player has 10 snowballs named "&6Waluta serwerowa":
					set {_ni} to 0
					loop items in player's inventory:
						if loop-item is any tool or any armor or any weapon or fishing rod:
							if durability of loop-item is not 0:
								repair loop-item
								add 1 to {_ni}
					if {_ni} > 0:
						remove 10 snowballs named "&6Waluta serwerowa" from player
						send "&aNaprawiono. Pobrano 10 waluty serwerowej"
					else:
						send "&cBrak przedmiotow do naprawy."
				else:
					send "&cMasz za malo waluty"
command /waluta:
	trigger:
		add 10 snowballs named "&6Waluta serwerowa" to player

 

 

Odnośnik do komentarza
https://skript.pl/temat/32791-naprawianie-za-walute/#findComment-212952
Udostępnij na innych stronach

  • 0

Sprawdzałem na 1.13.2, pewnie masz 1.8

 

zamiast

if player's tool is any tool or any armor or any weapon or fishing rod:

spróbuj wypisać itemy po kolei (troche tego bedzie)

if player's tool is wooden sword or stone sword or iron sword or golden sword or diamond sword or ...

ew. może takie coś zadziała

if "%player's tool%" contains "sword" or "pickaxe" or "axe" or "shovel" or "hoe" or "bow" or "fishing rod" or "helmet" or "chestplate" or "leggings" or "boots":

 

Odnośnik do komentarza
https://skript.pl/temat/32791-naprawianie-za-walute/#findComment-212960
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...