Skocz do zawartości

ulepszanie kilofa


Rekomendowane odpowiedzi

potrzebowalbym skryptu na ulepszanie kilofa, kilof by sie ulepszalo za pomoca tokenow, 20 expa = 1 token. tutaj enchanty:

 

wydajnosc 1 - 5 tokenow

wydajnosc 2 - 10 tokenow

wydajnosc 3 - 15 tokenow

fortuna 1 - 5 tokenow

fortuna 2 - 10 tokenow

fortuna 3 - 15 tokenow

 

i oczywiscie chcialbym tak aby kilof sie ulepszal po kolei czyli gdy np ktos ma wydajnosc 1 i 30 tokenow to nie zeby od razu mial wydajnosc 3 tylko wydajnosc 2 i pozniej wydajnosc 3

Odnośnik do komentarza
https://skript.pl/temat/56572-ulepszanie-kilofa/
Udostępnij na innych stronach

26 minut temu, knugi napisał:

A w jaki sposób ma być przeprowadzanie te ulepszanie? Za pomocą komendy? Czy system tokenów już posiadasz czy też trzeba zrobić? 

tak, za pomoca komendy. otwiera sie wtedy gui z ksiazkami i sobie mozesz ulepszyc. oczywiscie musisz miec kilof w reku i dobrze aby komenda wylapala jaki kto ma enchant na kilofie aby nie bylo tych "przeskokow". co do tokenow to chwila wiec sam sobie jestem w stanie ogarnac.

Odnośnik do komentarza
https://skript.pl/temat/56572-ulepszanie-kilofa/#findComment-338884
Udostępnij na innych stronach

To proszę bardzo:
 

Spoiler
options:
	guiName: Ulepsz kilof
	przedmiot: prismarine shard
on script load:
	set {xsvka::costEff::1} to 5
	set {xsvka::costEff::2} to 10
	set {xsvka::costEff::3} to 15
	set {xsvka::costFor::1} to 5
	set {xsvka::costFor::2} to 10
	set {xsvka::costFor::3} to 15
function upgradeTool(i: item) :: inventory:
	set {_gui} to chest with 1 rows named "{@guiName}"
	set {_eff} to enchantment level of efficiency on {_i} #efficiency of {_i}
	set {_for} to enchantment level of fortune on {_i} #fortune of {_i}
	set {_beff} to "enchanted book of efficiency %{_eff} + 1%" parsed as item
	set {_feff} to "enchanted book of fortune %{_for} + 1%" parsed as item
	if {_eff} + 1 is larger than 3:
		set slot 0 of {_gui} to {_beff} with lore "Nie mozesz bardziej ulepszyc wydajnosci."
	else:
		set {_eff} to {_eff} + 1
		set slot 0 of {_gui} to {_beff} with lore "Ulepsz do wydajnosci %{_eff}%" and "za: %{xsvka::costEff::%{_eff}%}% tokenow."
	if {_for} + 1 is larger than 3:
		set slot 1 of {_gui} to {_feff} with lore "Nie mozesz bardziej ulepszyc szczescia."
	else:
		set slot 1 of {_gui} to {_feff} with lore "Ulepsz do szczescia %{_for} + 1%" and "za: %{xsvka::costFor::%{_for} + 1%}% tokenow."
	return {_gui}
command /ulepsz:
	trigger:
		if player's tool is any pickaxe:
			open upgradeTool(player's tool) to player
			stop
		send "Trzymaj kilof w reku!"
on inventory click:
	event-inventory is not player's inventory
	if name of event-inventory is "{@guiName}":
		cancel event
		set {_x} to event-item
		if lore of {_x} contains "Nie mozesz bardziej ulepszyc":
			stop
		set {_lore::*} to lore of {_x}
		set {_lore::1} to last 1 character of {_lore::1} parsed as integer
		replace all "za: " and " tokenow." with "" in {_lore::2}
		set {_lore::2} to {_lore::2} parsed as integer
		if player's tool is any pickaxe:
			if player has {_lore::2} of {@przedmiot}:
				set {_ench::*} to enchantments of event-item
				remove {_lore::2} of {@przedmiot} from player
				enchant player's tool with {_ench::*}
				send "pomyslnie ulepszono."
				close player's inventory
				wait 2 tick
				open upgradeTool(player's tool) to player
				stop
			send "Nie posiadasz %{_lore::2}% tokenow."
			stop
		send "Trzymaj kilof w rece!"
		stop

 

Pozdrawiam #Knugi

Odnośnik do komentarza
https://skript.pl/temat/56572-ulepszanie-kilofa/#findComment-338890
Udostępnij na innych stronach

49 minut temu, knugi napisał:

To proszę bardzo:
 

  Pokaż ukrytą zawartość
options:
	guiName: Ulepsz kilof
	przedmiot: prismarine shard
on script load:
	set {xsvka::costEff::1} to 5
	set {xsvka::costEff::2} to 10
	set {xsvka::costEff::3} to 15
	set {xsvka::costFor::1} to 5
	set {xsvka::costFor::2} to 10
	set {xsvka::costFor::3} to 15
function upgradeTool(i: item) :: inventory:
	set {_gui} to chest with 1 rows named "{@guiName}"
	set {_eff} to enchantment level of efficiency on {_i} #efficiency of {_i}
	set {_for} to enchantment level of fortune on {_i} #fortune of {_i}
	set {_beff} to "enchanted book of efficiency %{_eff} + 1%" parsed as item
	set {_feff} to "enchanted book of fortune %{_for} + 1%" parsed as item
	if {_eff} + 1 is larger than 3:
		set slot 0 of {_gui} to {_beff} with lore "Nie mozesz bardziej ulepszyc wydajnosci."
	else:
		set {_eff} to {_eff} + 1
		set slot 0 of {_gui} to {_beff} with lore "Ulepsz do wydajnosci %{_eff}%" and "za: %{xsvka::costEff::%{_eff}%}% tokenow."
	if {_for} + 1 is larger than 3:
		set slot 1 of {_gui} to {_feff} with lore "Nie mozesz bardziej ulepszyc szczescia."
	else:
		set slot 1 of {_gui} to {_feff} with lore "Ulepsz do szczescia %{_for} + 1%" and "za: %{xsvka::costFor::%{_for} + 1%}% tokenow."
	return {_gui}
command /ulepsz:
	trigger:
		if player's tool is any pickaxe:
			open upgradeTool(player's tool) to player
			stop
		send "Trzymaj kilof w reku!"
on inventory click:
	event-inventory is not player's inventory
	if name of event-inventory is "{@guiName}":
		cancel event
		set {_x} to event-item
		if lore of {_x} contains "Nie mozesz bardziej ulepszyc":
			stop
		set {_lore::*} to lore of {_x}
		set {_lore::1} to last 1 character of {_lore::1} parsed as integer
		replace all "za: " and " tokenow." with "" in {_lore::2}
		set {_lore::2} to {_lore::2} parsed as integer
		if player's tool is any pickaxe:
			if player has {_lore::2} of {@przedmiot}:
				set {_ench::*} to enchantments of event-item
				remove {_lore::2} of {@przedmiot} from player
				enchant player's tool with {_ench::*}
				send "pomyslnie ulepszono."
				close player's inventory
				wait 2 tick
				open upgradeTool(player's tool) to player
				stop
			send "Nie posiadasz %{_lore::2}% tokenow."
			stop
		send "Trzymaj kilof w rece!"
		stop

 

Pozdrawiam #Knugi

jak mam na maxa ulepszony kilof to pokazuje sie wiadomosc "Nie posiadasz <none> tokenow."

Odnośnik do komentarza
https://skript.pl/temat/56572-ulepszanie-kilofa/#findComment-338891
Udostępnij na innych stronach

Dobra, złośliwość skrypta, zabezpieczyłem to, ale nie wykryło xD 
Masz poprawione: 

Spoiler
options:
	guiName: Ulepsz kilof
	przedmiot: prismarine shard
on script load:
	set {xsvka::costEff::1} to 5
	set {xsvka::costEff::2} to 10
	set {xsvka::costEff::3} to 15
	set {xsvka::costFor::1} to 5
	set {xsvka::costFor::2} to 10
	set {xsvka::costFor::3} to 15
function upgradeTool(i: item) :: inventory:
	set {_gui} to chest with 1 rows named "{@guiName}"
	set {_eff} to enchantment level of efficiency on {_i} #efficiency of {_i}
	set {_for} to enchantment level of fortune on {_i} #fortune of {_i}
	set {_beff} to "enchanted book of efficiency %{_eff} + 1%" parsed as item
	set {_feff} to "enchanted book of fortune %{_for} + 1%" parsed as item
	if {_eff} + 1 is larger than 3:
		set slot 0 of {_gui} to {_beff} with lore "Nie mozesz bardziej ulepszyc wydajnosci."
	else:
		set {_eff} to {_eff} + 1
		set slot 0 of {_gui} to {_beff} with lore "Ulepsz do wydajnosci %{_eff}%" and "za: %{xsvka::costEff::%{_eff}%}% tokenow."
	if {_for} + 1 is larger than 3:
		set slot 1 of {_gui} to {_feff} with lore "Nie mozesz bardziej ulepszyc szczescia."
	else:
		set slot 1 of {_gui} to {_feff} with lore "Ulepsz do szczescia %{_for} + 1%" and "za: %{xsvka::costFor::%{_for} + 1%}% tokenow."
	return {_gui}
command /ulepsz:
	trigger:
		if player's tool is any pickaxe:
			open upgradeTool(player's tool) to player
			stop
		send "Trzymaj kilof w reku!"
on inventory click:
	event-inventory is not player's inventory
	if name of event-inventory is "{@guiName}":
		cancel event
		if type of event-item is not enchanted book:
			stop
		set {_x} to event-item
		if "%lore of {_x}%" contains "Nie mozesz bardziej ulepszyc":
			stop
		set {_lore::*} to lore of {_x}
		set {_lore::1} to last 1 character of {_lore::1} parsed as integer
		replace all "za: " and " tokenow." with "" in {_lore::2}
		set {_lore::2} to {_lore::2} parsed as integer
		if player's tool is any pickaxe:
			if player has {_lore::2} of {@przedmiot}:
				set {_ench::*} to enchantments of event-item
				remove {_lore::2} of {@przedmiot} from player
				enchant player's tool with {_ench::*}
				send "pomyslnie ulepszono."
				close player's inventory
				wait 2 tick
				open upgradeTool(player's tool) to player
				stop
			send "Nie posiadasz %{_lore::2}% tokenow."
			stop
		send "Trzymaj kilof w rece!"
		stop

 

//Zmieniłem jeszcze, że jak kliknie w pusty slot to nie pokazuje wiadomości.

Edytowane przez knugi
Odnośnik do komentarza
https://skript.pl/temat/56572-ulepszanie-kilofa/#findComment-338892
Udostępnij na innych stronach

function upgradeTool(i: item) :: inventory:
	set {_gui} to chest with 1 rows named "{@guiName}"
	set slot 8 of {_gui} to {_i}
	set {_eff} to enchantment level of efficiency on {_i} #efficiency of {_i}
	set {_for} to enchantment level of fortune on {_i} #fortune of {_i}
	set {_beff} to "enchanted book of efficiency %{_eff} + 1%" parsed as item
	set {_feff} to "enchanted book of fortune %{_for} + 1%" parsed as item
	if {_eff} + 1 is larger than 3:
		set slot 0 of {_gui} to {_beff} with lore "Nie mozesz bardziej ulepszyc wydajnosci."
	else:
		set {_eff} to {_eff} + 1
		set slot 0 of {_gui} to {_beff} with lore "Ulepsz do wydajnosci %{_eff}%" and "za: %{xsvka::costEff::%{_eff}%}% tokenow."
	if {_for} + 1 is larger than 3:
		set slot 1 of {_gui} to {_feff} with lore "Nie mozesz bardziej ulepszyc szczescia."
	else:
		set slot 1 of {_gui} to {_feff} with lore "Ulepsz do szczescia %{_for} + 1%" and "za: %{xsvka::costFor::%{_for} + 1%}% tokenow."
	return {_gui}

 

Odnośnik do komentarza
https://skript.pl/temat/56572-ulepszanie-kilofa/#findComment-338898
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Nieaktywny
Dodaj odpowiedź do tematu...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

  • Ostatnio przeglądający   0 użytkowników

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