Skocz do zawartości
  • 1

losowanie


SeIniKs

Pytanie

Cześć, chciałbym żeby ktoś napisał mi skrypt na takie coś: Po wyrzuceniu 20 diamentów i jednego proszku glowstone pojawiał by się piorun który nie zadaje obrażeń a po nim skrzynka, w tej skrzynce jest szansa że będą takie itemy:
- Sztabka netherytu - 0.2%
- Odłamek netherytu - 0.7%
- Patyk knockback 3 - 1%
- Blok diamentów - 3%
- Blok emeraldów - 5%
- Blok złota - 10%
- Blok żelaza - 15%
- 5 Złote jabłka - 15%
- 3 Złote jabłka - 20%
- 1 Złote jabłko - 30%
- Łuk - 40%
-  20 Drewna - 50%

Z góry dzięki za poświęcony czas

PS moge sam sobie zrobic dropy tylko pokażcie mi jak je dodać

Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/
Udostępnij na innych stronach

12 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
W dniu 31.12.2020 o 23:28, SeIniKs napisał:

Cześć, chciałbym żeby ktoś napisał mi skrypt na takie coś: Po wyrzuceniu 20 diamentów i jednego proszku glowstone pojawiał by się piorun który nie zadaje obrażeń a po nim skrzynka, w tej skrzynce jest szansa że będą takie itemy:
- Sztabka netherytu - 0.2%
- Odłamek netherytu - 0.7%
- Patyk knockback 3 - 1%
- Blok diamentów - 3%
- Blok emeraldów - 5%
- Blok złota - 10%
- Blok żelaza - 15%
- 5 Złote jabłka - 15%
- 3 Złote jabłka - 20%
- 1 Złote jabłko - 30%
- Łuk - 40%
-  20 Drewna - 50%

Z góry dzięki za poświęcony czas

PS moge sam sobie zrobic dropy tylko pokażcie mi jak je dodać

 

function dropChest(l: location)
	delete {diamond::%player%} and {glowstone::%player%}
	strike lightning effect at {_l}
	set block at {_l} to chest
	chance of 0.2%:
		add netherite ingot to (inventory of block at {_l})
	chance of 0.7%:
		add netherite scrap to (inventory of block at {_l})
	chance of 1%:
		add stick of knockback 3 to (inventory of block at {_l})
	(...)


on drop:
	if event-item is a diamond:
		if amount of event-item = 20:
			if {glowstone::%player%} is not set:
				set {diamond::%player%} to true
			else:
				dropChest(location of player)
	else is event-item is glowstone dust:
		if {diamond::%player%} is not set:
			set {glowstone::%player%} to true
		else:
			dropChest(location of player)
Edytowane przez PanMaruda
Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-277814
Udostępnij na innych stronach

  • 0

@PanMaruda
Skrypt ma aż 26 błędów.

Wysyłam logi z konsoli
 

[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 1 tab (lootchests.sk, line 2: delete {diamond::%player%} and {glowstone::%player%}')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 1 tab (lootchests.sk, line 3: strike lightning effect at {_l}')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 1 tab (lootchests.sk, line 4: set block at {_l} to chest')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 1 tab (lootchests.sk, line 5: chance of 0.2%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 6: add netherite ingot to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 1 tab (lootchests.sk, line 7: chance of 0.7%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 8: add netherite scrap to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 1 tab (lootchests.sk, line 9: chance of 1%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 10: add stick of knockback 3 to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 4 spaces (lootchests.sk, line 11: chance of 3%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 12: add diamond block to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 1 tab (lootchests.sk, line 13: chance of 5%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 14: add emerald block to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 4 spaces (lootchests.sk, line 15: chance of 10%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 16: add gold block to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 4 spaces (lootchests.sk, line 17: chance of 15%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 18: add iron block to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 4 spaces (lootchests.sk, line 19: chance of 15%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 20: add 5 golden apple to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 4 spaces (lootchests.sk, line 21: chance of 20%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 22: add 2 golden apple to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 4 spaces (lootchests.sk, line 23: chance of 50%:')
[10:04:27] [Server thread/ERROR]: [Skript] indentation error: expected 0 tabs, but found 2 tabs (lootchests.sk, line 24: add emerald to (inventory of block at {_l})')
[10:04:27] [Server thread/ERROR]: [Skript] invalid line - all code has to be put into triggers (lootchests.sk, line 1: function dropChest(l: location)')
[10:04:27] [Server thread/ERROR]: [Skript] 'event-item stack' can only ever have one value at most, thus the 'amount of ...' expression is useless. Use '... exists' instead to find out whether the expression has a value. (lootchests.sk, line 29: if amount of event-item = 20:')
[10:04:27] [Server thread/ERROR]: [Skript] can't understand this condition: 'else is event-item is glowstone dust' (lootchests.sk, line 34: else is event-item is glowstone dust:')

 

Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-277982
Udostępnij na innych stronach

  • 0
function dropChest(l: location):
	delete {diamond::%player%} and {glowstone::%player%}
	strike lightning effect at {_l}
	set block at {_l} to chest
	chance of 0.2%:
		add netherite ingot to (inventory of block at {_l})
	chance of 0.7%:
		add netherite scrap to (inventory of block at {_l})
	chance of 1%:
		add stick of knockback 3 to (inventory of block at {_l})
	#(...)


on drop:
	if event-item is a diamond:
		if amount of event-item = 20:
			if {glowstone::%player%} is not set:
				set {diamond::%player%} to true
			else:
				dropChest(location of player)
	else is event-item is glowstone dust:
		if {diamond::%player%} is not set:
			set {glowstone::%player%} to true
		else:
			dropChest(location of player)

 

Edytowane przez PanMaruda
Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-277985
Udostępnij na innych stronach

  • 0
Teraz, PanMaruda napisał:

nie

1. Użyłeś playera w funkcji.

2. Ilość itemu sprawdzamy za pomocą wyrażenia 'item amount of [twój przedmiot]'.

3. W 'else if' masz literówkę.

Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-277991
Udostępnij na innych stronach

  • 0
14 minut temu, SeIniKs napisał:

@Kormic
to wkońcu dobrze jest skrypt zrobiony czy nie?

Nie, nie jest dobrze zrobiony, ale jeżeli Pan Maruda je poprawi, to będzie dobry.

W pierwszym błędzie należy oczywiście przesłać argument typu player do funkcji.

Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-277998
Udostępnij na innych stronach

  • 0
function dropChest(l: location):
	strike lightning effect at {_l}
	set block at {_l} to chest
	chance of 0.2%:
		add netherite ingot to (inventory of block at {_l})
	chance of 0.7%:
		add netherite scrap to (inventory of block at {_l})
	chance of 1%:
		add stick of knockback 3 to (inventory of block at {_l})
	#(...)


on drop:
	if event-item is a diamond:
		if item amount of event-item = 20:
			if {glowstone::%player%} is not set:
				set {diamond::%player%} to true
			else:
				dropChest(location of player)
				delete {diamond::%player%} and {glowstone::%player%}
	else if event-item is glowstone dust:
		if {diamond::%player%} is not set:
			set {glowstone::%player%} to true
		else:
			dropChest(location of player)
			delete {diamond::%player%} and {glowstone::%player%}

 

Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-277999
Udostępnij na innych stronach

  • 0
3 godziny temu, PanMaruda napisał:


function dropChest(l: location):
	strike lightning effect at {_l}
	set block at {_l} to chest
	chance of 0.2%:
		add netherite ingot to (inventory of block at {_l})
	chance of 0.7%:
		add netherite scrap to (inventory of block at {_l})
	chance of 1%:
		add stick of knockback 3 to (inventory of block at {_l})
	#(...)


on drop:
	if event-item is a diamond:
		if item amount of event-item = 20:
			if {glowstone::%player%} is not set:
				set {diamond::%player%} to true
			else:
				dropChest(location of player)
				delete {diamond::%player%} and {glowstone::%player%}
	else if event-item is glowstone dust:
		if {diamond::%player%} is not set:
			set {glowstone::%player%} to true
		else:
			dropChest(location of player)
			delete {diamond::%player%} and {glowstone::%player%}

 

Teraz nie ma ani jednego błędu - ale nie działa

 

@PanMaruda

Możesz naprawić?

 

3 godziny temu, SeIniKs napisał:

Teraz nie ma ani jednego błędu - ale nie działa

 

Nieaktywny

Łączę posty.

Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-278000
Udostępnij na innych stronach

  • 0
7 godzin temu, SeIniKs napisał:

Teraz nie ma ani jednego błędu - ale nie działa

@PanMaruda
Możesz naprawić?

dopóki mi nie napiszesz co się dzieje, co się nie dzieje i co się dziać powinno to nie, nie jestem w stanie naprawić.

błędy z konsoli po użyciu skryptu również mile widziane
wersja skripta serwera, silnik i takie tam

Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-278071
Udostępnij na innych stronach

  • 0
47 minut temu, PanMaruda napisał:

dopóki mi nie napiszesz co się dzieje, co się nie dzieje i co się dziać powinno to nie, nie jestem w stanie naprawić.

błędy z konsoli po użyciu skryptu również mile widziane
wersja skripta serwera, silnik i takie tam

No skrypt po reloadzie nie wyświetla błędów. Lecz po wyrzuceniu 20 diamentów i jednego glowstone nic się nie dzieje. Ale na konsoli nie ma też błędów.

Skript - najnowszy

Spigot - 1.16.1

 

Odnośnik do komentarza
https://skript.pl/temat/44227-losowanie/#findComment-278117
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.

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

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