Skocz do zawartości
  • 0

Ksiazki od razu bez kowadła


Pytanie

Witam, Potrzebuje skript który miałby za zadanie dodać do miecza enchant z książki mianowicie mamy książkę w ekwipunku i chcemy ją na mieczyk ale nie mamy expa ani kowadła no to chce aby to było uproszczone

gdy przyciągniemy książkę z sharpness 4 na miecz diamentowy to daje nam właśnie ten enchant do tego miecza :). (za starania dziękuje) oraz lajkuje !

 

Edytowane przez Wirus
Odnośnik do komentarza
https://skript.pl/temat/25144-ksiazki-od-razu-bez-kowad%C5%82a/
Udostępnij na innych stronach

6 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
on any move:
	if player has 1 diamond sword:
		if player has 1 enchanted book of sharpness 4:
        	remove enchanted book of sharpness 4 from player
            	remove diamond sword from player
            	give 1 diamond sword of sharpness 4 to player

O takie coś chodzi?

Liczę na +!

Odnośnik do komentarza
https://skript.pl/temat/25144-ksiazki-od-razu-bez-kowad%C5%82a/#findComment-167152
Udostępnij na innych stronach

  • 0

Chyba raczej to nie to, bo to miało być tak że mamy książkę np sharpness 4 no to jak przyciągniemy ją w ekwipunku na miecz diamentowy to daje nam właśnie ten enchant i znika ta książka :/

a tak wgl to aż 3 błędy to wymaga jakiegoś dodatku?.

Edytowane przez Wirus
Odnośnik do komentarza
https://skript.pl/temat/25144-ksiazki-od-razu-bez-kowad%C5%82a/#findComment-167153
Udostępnij na innych stronach

  • 0

@Wirus a nie lepiej stworzyć komendę, która otwiera kowadło i ustawić wymagany exp na 0 ;)

Ale jeżeli nie, to postaram się takie coś napisać, nie ukrywam, że będziesz musiał chyba doinstalować jeden z dodatków

 

 

//Edit, napisałem.

Należy się dla mnie dobry zimny czteropak piwa :3

Spoiler

#SkMorkaz, SkQuery,
function send(t: text):
	send "%{_t}%" to "knugi" parsed as offlineplayer
function getGoodEnchantments(i: item type) :: text:
	if {_i} is any sword:
		return "fire aspect, looting, sharpness, bane of arthropods, knockback, smite, unbreaking"
		stop
	if {_i} is bow:
		return "flame, infinity, power, punch, unbreaking"
		stop
	if {_i} is any axe:
		return "efficiency, fortune, silk touch, unbreaking"
		stop
	if {_i} is any pickaxe or any shovel:
		return "efficiency, fortune, silk touch, unbreaking"
		stop
	if {_i} is fishing rod:
		return "luck of the sea, lure, unbreaking"
		stop
	return ""
function isGood(i1: item type, i2: item type) :: string:
	set {_enchantments::*} to split getGoodEnchantments({_i2}) at ", "
	if size of {_enchantments::*} is smaller than 2:
		return "false"
		stop
	loop {_enchantments::*}:
		set {_x} to "%loop-value%" parsed as enchantment
		if {_i1} is enchanted with {_x}:
			set {_isGood} to true
			exit loop
	if {_isGood} is set:
		if {_i2} is enchanted with {_x}:
			if {_i1}'s {_x} level is larger than {_i2}'s {_x} level:
				return "true"
			else if {_i1}'s {_x} level is equal to {_i2}'s {_x} level:
				return "%{_i1}'s {_x} level + 1%"
			else:
				return "false"
		else:
			return "true"
on mor.inventory click:
	set {_cursor} to cursor item of player
	if {_cursor} is enchanted book:
		if {_cursor} is enchanted:
			set {_i2} to event-item
			set {_isGood} to isGood({_cursor}, {_i2})
			if {_isGood} is "false":
				stop
			else if {_isGood} is "true":
				cancel event
				set cursor item of player to air
				set {_} to "%enchants of {_cursor}%" parsed as enchantment
				set {_ench} to "%enchants of {_cursor}% %{_cursor}'s {_} level%" parsed as enchantment type
				enchant slot event-number of event-inventory with {_ench}
				stop
			else:
				#Enchant na returna isGood jest integerem
				cancel event
				set cursor item of player to air
				set {_ench} to "%enchants of {_cursor}% %{_isGood}%" parsed as enchantment type
				enchant slot event-number of event-inventory with {_ench}
				stop
			stop

 

Potrzebujesz takiego dodatku jak: SkMorkaz (tylko na nim znalazłem odpowiednie dla mnie funkcje, by poprawnie skrypt działał)

Edytowane przez knugi
Dodano skrypt
Odnośnik do komentarza
https://skript.pl/temat/25144-ksiazki-od-razu-bez-kowad%C5%82a/#findComment-167598
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ę...