Skocz do zawartości
  • 0

Skrypt na losowanie w GUI


Pytanie

Siema próbowałem zrobić skrypt na losowanie w GUI, błędów żadnych nie ma, ale jakoś dziwnie to się losuje + nie daje graczowi itemu który wylosował. Poprawiłby ktoś?

command /opencase:
	trigger:
		if {case::%player%::otworzona} is true:
			send " Juz otwierasz skrzynie!" to player
		else:
			remove 1 chest named "Test" from player's inventory
			set {case::%player%::open} to true
			set {case::%player%::otworzona} to true
			open chest with 6 rows named "Skrzynia" to player
			wait 2 tick
			loop 9 times:
				format slot loop-number + 8 of player with stone to be unstealable
				format slot loop-number - 1 of player with 1 of black stained glass pane to be unstealable
				format slot loop-number + 17 of player with 1 of black stained glass pane to be unstealable
			format slot 4 of player with 1 of hopper to be unstealable
			set {_random} to random integer between 20 and 30
			wait 1 seconds
			loop {_random} times:
				if loop-number > 15:
					loop loop-number - 12 times:
						wait 1 tick
				else:
					wait 3 tick
				loop 8 times:
					if {case::%player%::open} is true:
						format slot loop-number-2 + 8 of player with dirt to be unstealable
					if {case::%player%::open} is true:
						format slot 17 of player with cobblestone to be unstealable
			set {case::%player%::open} to false
			wait 1 second
			set {case::%player%::otworzona} to false

 

Edytowane przez lizz0r
Odnośnik do komentarza
https://skript.pl/temat/18365-skrypt-na-losowanie-w-gui/
Udostępnij na innych stronach

11 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
command /dodajitem:
	trigger:
		if player's tool is air:
			send "&cNie dodawaj powietrza."
		else:
			add player's tool to {itemy::*}
			send "&edodales: &f%player's tool%"

on rightclick:
	if player's tool is chest named "test":
		set {_x::*} to {itemy::*}:
		open chest with 3 rows named "&eLosowanie..."
		loop (size of {itemy::*}) times:
			set {_z} to random elements out of {_x::*}
			format slot 12 of player with 1 of {_z} to close
			remove {_z} from {_x::*}
			wait 1 seconds
		set {_y} to random elements out of {_x::*}
		format slot 12 of player with 1 of {_y} to close
		give player {_y}
		send "&eWylosowales &6{_y}"
			
		

 

Odnośnik do komentarza
https://skript.pl/temat/18365-skrypt-na-losowanie-w-gui/#findComment-125615
Udostępnij na innych stronach

  • 0
command /dodajitem:
	trigger:
		if player's tool is air:
			send "&cNie dodawaj powietrza."
		else:
			add player's tool to {itemy::*}
			send "&edodales: &f%player's tool%"

on rightclick:
	if player's tool is chest named "test":
		set {_x::*} to {itemy::*}
		open chest with 3 rows named "&eLosowanie..."
		loop (size of {itemy::*}) times:
			set {_z} to random elements out of {_x::*}
			format slot 12 of player with 1 of {_z} to close
			remove {_z} from {_x::*}
			wait 1 seconds
		set {_y} to random elements out of {_x::*}
		format slot 12 of player with 1 of {_y} to close
		give player {_y}
		send "&eWylosowales &6%{_y}%"
			

 

Odnośnik do komentarza
https://skript.pl/temat/18365-skrypt-na-losowanie-w-gui/#findComment-125652
Udostępnij na innych stronach

  • 0

@xTea_199 błędy: [20:42:43 ERROR]: Can't understand this condition/effect: open chest with 3 rows named "&eLosowanie..." (wiadomosc.sk, line 106: open chest with 3 rows named "&eLosowanie..."')
[20:42:43 ERROR]: '::*}' is not a valid item data (wiadomosc.sk, line 108: set {_z} to random elements out of {_x::*}')
[20:42:43 ERROR]: '::*}' is not a valid item data (wiadomosc.sk, line 112: set {_y} to random elements out of {_x::*}')

Odnośnik do komentarza
https://skript.pl/temat/18365-skrypt-na-losowanie-w-gui/#findComment-125656
Udostępnij na innych stronach

  • 0
command /dodajitem:
	trigger:
		if player's tool is air:
			send "&cNie dodawaj powietrza."
		else:
			add player's tool to {itemy::*}
			send "&edodales: &f%player's tool%"

on rightclick:
	if player's tool is chest named "test":
		set {_x::*} to {itemy::*}
		open chest with 3 rows named "&eLosowanie..." to player
		loop (size of {itemy::*}) times:
			set {_z} to random item out of {_x::*}
			format slot 12 of player with 1 of {_z} to close
			remove {_z} from {_x::*}
			wait 1 seconds
		set {_y} to random item out of {_x::*}
		format slot 12 of player with 1 of {_y} to close
		give player {_y}
		send "&eWylosowales &6%{_y}%"
			

 

6 minut temu, lizz0r napisał:

@xTea_199 błędy: [20:42:43 ERROR]: Can't understand this condition/effect: open chest with 3 rows named "&eLosowanie..." (wiadomosc.sk, line 106: open chest with 3 rows named "&eLosowanie..."')
[20:42:43 ERROR]: '::*}' is not a valid item data (wiadomosc.sk, line 108: set {_z} to random elements out of {_x::*}')
[20:42:43 ERROR]: '::*}' is not a valid item data (wiadomosc.sk, line 112: set {_y} to random elements out of {_x::*}')

 

Odnośnik do komentarza
https://skript.pl/temat/18365-skrypt-na-losowanie-w-gui/#findComment-125658
Udostępnij na innych stronach

  • 0
37 minut temu, lizz0r napisał:

@KrejzolekPRO [20:28:02 ERROR]: can't understand this condition: 'set {_x::*} to {itemy::*}' (wiadomosc.sk, line 77: set {_x::*} to {itemy::*}:')

przy skrzynce dodaj to player i przy set usuń :

Odnośnik do komentarza
https://skript.pl/temat/18365-skrypt-na-losowanie-w-gui/#findComment-125660
Udostępnij na innych stronach

  • 0

Po wylosowaniu nie zamyka mi tej skrzynki, na chacie pisze wylosowałes <none>, nie dodaje itemu do eq, i dodałby ktoś możliwość żebym sobie ustawiał jaki % szans jest na wypadnięcie itemu

Edytowane przez lizz0r
Odnośnik do komentarza
https://skript.pl/temat/18365-skrypt-na-losowanie-w-gui/#findComment-125662
Udostępnij na innych stronach

  • 0
2 minuty temu, lizz0r napisał:

Po wylosowaniu nie zamyka mi tej skrzynki, na chacie pisze wylosowałes <none>, nie dodaje itemu do eq, i dodałby ktoś możliwość żebym sobie ustawiał jaki % szans jest na wypadnięcie itemu

A dodałeś itemy /dodajitem?

Odnośnik do komentarza
https://skript.pl/temat/18365-skrypt-na-losowanie-w-gui/#findComment-125664
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ę...