Skocz do zawartości
  • 0

NIe wykrywa fortune na kilofie...


RaZer
 Udostępnij

Pytanie

Tak jak w temacie... Mam sobie

if player's tool is enchanted with fortune 3:

i tak po kolei 1,2,3 i nie wykrywa mi w ogóle tego enchantu :/ co robię źle?

on mine of stone:
    if {turbodrop::status::%player%} is "&4NIE":
        if player has permission "vip.drop":
            if player is holding any pickaxe:
                if player's tool is not enchanted with fortune 1 or fortune 2 or fortune 3:
                    #Diament
                    chance of 0.3%:
                        if {diamond::status::%player%} is "&aTAK":
                            if player have enough space for 1 of diamond:
                                give 1 of diamond to player
                                if {messages::status::%player%} is "&aTAK":
                                    send "Otrzymales 1 diament bez fortuny" to player
                                    stop
                                else:
                                    stop
                            else:
                                drop 1 of diamond at event-block
                                if {messages::status::%player%} is "&aTAK":
                                    send "Otrzymales 1 diament bez fortuny" to player
                                    stop
                                else:
                                    stop
				else:
					if player's tool is enchanted with fortune 1:
                        #Diament
                        chance of 0.4%:
                            if {diamond::status::%player%} is "&aTAK":
                                set {_i} to random integer between 1 and 2
                                if player have enough space for {_i} of diamond:
                                    give {_i} of diamond to player
                                    if {messages::status::%player%} is "&aTAK":
                                        send "Otrzymales %{_i}% diament fortune 1" to player
                                        stop
                                    else:
                                        stop
                                else:
                                    drop {_i} of diamond at event-block
                                    if {messages::status::%player%} is "&aTAK":
                                        send "Otrzymales %{_i}% diament fortune 1" to player
                                        stop
                                    else:
                                        stop
					else:
						if player's tool is enchanted with fortune 2:
                          #Diament
                          chance of 0.5%:
                              if {diamond::status::%player%} is "&aTAK":
                                  set {_i} to random integer between 1 and 2
                                  if player have enough space for {_i} of diamond:
                                      give {_i} of diamond to player
                                      if {messages::status::%player%} is "&aTAK":
                                          send "Otrzymales %{_i}% diament fortune 2" to player
                                          stop
                                      else:
                                          stop
                                  else:
                                      drop {_i} of diamond at event-block
                                      if {messages::status::%player%} is "&aTAK":
                                          send "Otrzymales %{_i}% diament fortune 2" to player
                                          stop
                                      else:
                                          stop
						else:
							if player's tool is enchanted with fortune 3:
                              #Diament
                              chance of 0.6%:
                                  if {diamond::status::%player%} is "&aTAK":
                                      set {_i} to random integer between 1 and 2
                                      if player have enough space for {_i} of diamond:
                                          give {_i} of diamond to player
                                          if {messages::status::%player%} is "&aTAK":
                                              send "Otrzymales %{_i}% diament fortune 3" to player
                                              stop
                                          else:
                                              stop
                                      else:
                                          drop {_i} of diamond at event-block
                                          if {messages::status::%player%} is "&aTAK":
                                              send "Otrzymales %{_i}% diament fortune 3" to player
                                              stop
                                          else:
                                              stop

co tu jest nie tak, że tego nie wykrywa??

Edytowane przez RaZer
Odnośnik do komentarza
Udostępnij na innych stronach

14 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Z tego co widzę masz jeden warunek od sprawdzania enchantu i jest to sprawdzenie czy w ogole nie ma enchantu i po kolei leca szanse na wylosowanie wiadomosci o aktualnym fortune. 

 

Nawet w kodzie nie masz expressionu: 

14 minut temu, RaZer napisał:

if player's tool is enchanted with fortune 3:

 

///Dobra cofam swoje słowa. Masz błędnie taby ustawione :P

Edytowane przez knugi
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@knugi to co widzisz było sklejane na szybko ogólnie działa wszystko poza tym wykrywaniem fortune :/ taby są zrobione dobrze w moim kodzie bo nie sypie nic.

            if player is holding any pickaxe of fortune 1:
                send "ok fortune 1"
            else:
                if player is holding any pickaxe of fortune 2:
                    send "ok 2"
                else:
                    if player is holding any pickaxe of fortune 3:
                        send "ok 3"
                    else:
                        if player is not holding any pickaxe of fortune:

//Edit to co jest teraz wyżej to są moje debugi które nie działają :/ oczywiście jest sobie on mine of stone wyżej

//Edit2

To na przykład zwraca mi tylko send "fortune 1"

on mine of stone:
    if {turbodrop::status::%player%} is "&4NIE":
        if player has permission "vip.drop":
            if player is holding any pickaxe:
                if player's held item is enchanted with fortune 1:
                    send "ok fortune 1"
                else:
                    if player's held item is enchanted with fortune 2:
                        send "ok 2"
                    else:
                        if player's held item is enchanted with fortune 3:
                            send "ok 3"
                        else:
                            if player's held item is not enchanted with fortune:

 

Edytowane przez RaZer
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Ogólnie to był bajzel z tym kodem, masz tu trochę poprawiony dla oka:

Spoiler
on mine of stone:
	if {turbodrop::status::%player%} is "&4NIE":
		if player has permission "vip.drop":
			if player is holding any pickaxe:
				if {diamond::status::%player%} is "&aTak":
					#Diament
					if player's tool is not enchanted with fortune 1 or fortune 2 or fortune 3:
						chance of 0.3%:
							if player have enough space for 1 of diamond:
								give 1 of diamond to player
								if {messages::status::%player%} is "&aTAK":
									send "Otrzymales 1 diament bez fortuny" to player
								stop
							drop 1 of diamond at event-block
							if {messages::status::%player%} is "&aTAK":
								send "Otrzymales 1 diament bez fortuny" to player
							stop
					if player's tool is enchanted with fortune 1:
						chance of 0.4%:
							set {_i} to random integer between 1 and 2
							if player have enough space for {_i} of diamond:
								give {_i} of diamond to player
								if {messages::status::%player%} is "&aTAK":
									send "Otrzymales %{_i}% diament fortune 1" to player
								stop
							drop {_i} of diamond at event-block
							if {messages::status::%player%} is "&aTAK":
								send "Otrzymales %{_i}% diament fortune 1" to player
							stop
					if player's tool is enchanted with fortune 2:
						chance of 0.5%:
							set {_i} to random integer between 1 and 2
							if player have enough space for {_i} of diamond:
								give {_i} of diamond to player
								if {messages::status::%player%} is "&aTAK":
									send "Otrzymales %{_i}% diament fortune 2" to player
								stop
							else:
								drop {_i} of diamond at event-block
								if {messages::status::%player%} is "&aTAK":
									send "Otrzymales %{_i}% diament fortune 2" to player
								stop
					if player's tool is enchanted with fortune 3:
						chance of 0.6%:
							set {_i} to random integer between 1 and 2
							if player have enough space for {_i} of diamond:
								give {_i} of diamond to player
								if {messages::status::%player%} is "&aTAK":
									send "Otrzymales %{_i}% diament fortune 3" to player
								stop
							drop {_i} of diamond at event-block
							if {messages::status::%player%} is "&aTAK":
								send "Otrzymales %{_i}% diament fortune 3" to player
								stop	

 

A tutaj to bardzo dziwna sytuacja:

9 minut temu, RaZer napisał:

To na przykład zwraca mi tylko send "fortune 1"

on mine of stone:
    if {turbodrop::status::%player%} is "&4NIE":
        if player has permission "vip.drop":
            if player is holding any pickaxe:
                if player's held item is enchanted with fortune 1:
                    send "ok fortune 1"
                else:
                    if player's held item is enchanted with fortune 2:
                        send "ok 2"
                    else:
                        if player's held item is enchanted with fortune 3:
                            send "ok 3"
                        else:
                            if player's held item is not enchanted with fortune:

 

Ale ogólnie takim drzewem ifów się nie robi skryptów.

Ten kod bym zapisał tak:

on mine of stone:
	if {turbodrop::status::%player%} is "&4NIE":
		if player has permission "vip.drop":
			if player is holding any pickaxe:
				if player's held item is not enchanted with fortune:
					send "ok 0
					stop
				if player's held item is enchanted with fortune 1:
					send "ok  1"
					stop
				if player's held item is enchanted with fortune 2:
					send "ok 2"
					stop
				if player's held item is enchanted with fortune 3:
					send "ok 3"
				
							
	

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
2 minuty temu, RaZer napisał:

@knugi zrobiłeś identycznie jak ja teraz i zwraca mi tylko ok 1 do każdej fortuny do 1 do 2 i do 3 ... :/

zatem jest błąd w samym pluginie skript.

Poproszę owe informacje z tych dwóch komend:

/ver 

/ver sk

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@knugi

To od /ver
This server is running Paper version git-Paper-1618 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)
Error obtaining version information
To od /ver sk

Skript version 2.5.3
Customize Minecraft's mechanics with simple scripts written in plain English sentences.
Website: https://skriptlang.github.io/Skript
Authors: Njol, Mirreski, bensku, TheBentoBox, FranKusmiruk, ShaneBeee, Blueyescat, JRoy, Nicofisi, APickledWalrus, xXAndrew28Xx, Syst3ms, TheLimeGlass, Pikachu920, Sashie, Wealthyturtle, OfficialDonut and eyesniper2
SkQuery version 4.1.4
Authors: LimeGlass and w00tmast3r
TuSKe version 1.8.2-Pikachu-Patch-3
A Skript Addon which has some managers, such as custom enchantments, recipes and GUI inventory, and some general stuffs.
Author: Tuke_Nuke

 

Edytowane przez RaZer
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

To fakt. 
Akurat te wersje co masz posiadają takowy bład. Ja do celów prywatnych stworzyłem swój własny dodatek:

Zarejestruj się lub zaloguj, aby zobaczyć ukrytą treść!

 

Tutaj jego dokumentacja:

#all enchantments
#max enchant lvl of %enchantment%
#all enchants of %itemstack%
#ench lvl of %enchantment%

#%itemstack% can enchant with %enchantment%
#%enchantment% conflicts with %enchantment%

I robisz coś takiego:

command /test:
	trigger:
		set {_enchants::*} to all enchants of player's tool
		loop {_enchants::*}:
			if "%loop-value%" contains "fortune":
				if ench lvl of loop-value is 1:
					send "fortune 1"
					stop
				if ench lvl of loop-value is 1:
					send "fortune 2"
					stop
				if ench lvl of loop-value is 1:
					send "fortune 3"
					stop

 

Edytowane przez knugi
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@knugi no ale to nie będzie tak, że będzie loopować za każdym razem jak gracz sobie wykopie stone?

//Edit

{_enchants::*} can't be set to 'all enchants of player's tool' because the latter is not an object (drop.sk, line 259: set {_enchants::*} to all enchants of player's tool')

 

Edytowane przez RaZer
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
1 minutę temu, RaZer napisał:

@knugi no ale to nie będzie tak, że będzie loopować za każdym razem jak gracz sobie wykopie stone?

ano pewnie będzie. 

To zajrzyjmy może do dokumentacji, może coś tam się znajdzie.

Zarejestruj się lub zaloguj, aby zobaczyć ukrytą treść!

Być może zauważyłem teraz zadziała inna funkcja (w co wątpię):

if level of fortune of the player's tool is 1

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Ewentualnie zrobić taki myk:

set {_ench} to "fortune" parsed as enchantments
set {_tool} to player's tool
send "%level of {_ench} of {_tool}%" to player
if level of {_ench} of {_tool} is 1:
	send "fortune 1"
	stop	
if level of {_ench} of {_tool} is 2:
	send "for 2"
	stop
if level of {_ench} of {_tool} is 3:
	send "for 3":
	stop

 

Odnośnik do komentarza
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
Odpowiedz na pytanie...

×   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.

 Udostępnij

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

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