Skocz do zawartości
  • 0

Zdrapki na 3 itemy


TheFightaz

Pytanie

Siemka,
Potrzebuje, aby ktoś mi zaczął skrypt, bo nie mam pojęcia jak go zacząć.

Mianowicie, otwiera nam sie gui po komendzie, i okienko 3x3 (gui juz mam) gdy gracz kliknie na któreś okienko to szkło zamienia się w item, następnie ma jeszcze 3 próby, gdy trafi 3 razy ten sam przedmiot, to gui się zamyka i gracz dostaje ten przedmiot, gdy gracz nie trafi 3 razy tego samego przedmiotu gui się zamyka i nic nie dostaje. 

Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/
Udostępnij na innych stronach

Rekomendowane odpowiedzi

  • 0
Teraz, CoFFeIN04 napisał:

nie zamyka się nawet ekwipunek? w konsoli żadnych błędów?

W konsoli zero błędów, ekwipunek tez sie nie zamyka, moge klikać w te szkło ile chce, ale nagrody nie daje ;/

Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/#findComment-294770
Udostępnij na innych stronach

  • 0
on inventory click:
	send "1"
	inventory name of current inventory of player is "&2&lMC&6&lSquare&f&l.pl &8&l| &6&lZDRAPKI &8&l|"
	send "2"
	clicked inventory is not player's inventory
	send "3"
	cancel event
	event-item is blue stained glass
	send "4"
	if amount of blue stained glass in player's current inventory > 6:
		send "5"
		set {_it} to (random element out of {prize::*}) parsed as item
		set {_am} to random integer between 1 and 5
		set slot (index of event-item) of player's current inventory to {_am} of {_}
		give {_am} of {_} to the player
		send "6"
		stop
	send "7"
	clear player's inventory

zrób tak i pokaż jakie cyfry widzisz na chacie

Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/#findComment-294771
Udostępnij na innych stronach

  • 0
2 minuty temu, CoFFeIN04 napisał:

on inventory click:
	send "1"
	inventory name of current inventory of player is "&2&lMC&6&lSquare&f&l.pl &8&l| &6&lZDRAPKI &8&l|"
	send "2"
	clicked inventory is not player's inventory
	send "3"
	cancel event
	event-item is blue stained glass
	send "4"
	if amount of blue stained glass in player's current inventory > 6:
		send "5"
		set {_it} to (random element out of {prize::*}) parsed as item
		set {_am} to random integer between 1 and 5
		set slot (index of event-item) of player's current inventory to {_am} of {_}
		give {_am} of {_} to the player
		send "6"
		stop
	send "7"
	clear player's inventory

zrób tak i pokaż jakie cyfry widzisz na chacie

Za kazdym razem jak klikne w niebieskie szklo to na chacie wyświetla sie odrazu numer "1","2","3" 

Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/#findComment-294772
Udostępnij na innych stronach

  • 0
on inventory click:
	inventory name of current inventory of player is "&2&lMC&6&lSquare&f&l.pl &8&l| &6&lZDRAPKI &8&l|"
	clicked inventory is not player's inventory
	cancel event
	item at clicked slot is blue stained glass
	if amount of blue stained glass in player's current inventory > 6:
		set {_it} to "%random element out of {prize::*}%" parsed as item
		set {_am} to random integer between 1 and 5
		set slot (index of clicked slot) of player's current inventory to {_am} of {_}
		give {_am} of {_} to the player
		stop
	clear player's inventory

a teraz?

Edytowane przez CoFFeIN04
Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/#findComment-294773
Udostępnij na innych stronach

  • 0
1 minutę temu, CoFFeIN04 napisał:

on inventory click:
	inventory name of current inventory of player is "&2&lMC&6&lSquare&f&l.pl &8&l| &6&lZDRAPKI &8&l|"
	clicked inventory is not player's inventory
	cancel event
	item at clicked item is blue stained glass
	if amount of blue stained glass in player's current inventory > 6:
		set {_it} to "%random element out of {prize::*}%" parsed as item
		set {_am} to random integer between 1 and 5
		set slot (index of clicked slot) of player's current inventory to {_am} of {_}
		give {_am} of {_} to the player
		stop
	clear player's inventory

a teraz?

Dalej nic po kliknięciu i wywala error https://imgur.com/a/cYFyxUB

Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/#findComment-294774
Udostępnij na innych stronach

  • 0

Dobra, czyściło ekwipunek bo zamiast close dałem clear XD

tutaj gotowy kod, który został przeze mnie przetestowany i działa:

options:
	item1: dirt
	item2: stone
	item3: diamond
	item4: emerald
	item5: obsidian
	item6: chest
	item7: sand
	item8: sandstone
	item9: diamond

on load:
	set {prize::*} to {@item1}, {@item2}, {@item3}, {@item4}, {@item5}, {@item6}, {@item7}, {@item8} and {@item9}

command /zdrapka [<text>]:
	trigger:
		open chest inventory named "&2&lMC&6&lSquare&f&l.pl &8&l| &6&lZDRAPKI &8&l|" with 5 rows to player
		set slot (integers from 0 to 9), 17, 18, 26, 27, (integers from 35 to 45) of player's current inventory to gray stained glass pane named "" with lore ""
		set slot 10,11,15,16,19,20,24,25,28,29,33 and 34 of player's current inventory to white stained glass pane named "" with lore ""
		set slot 12,13,14,21,22,23,30,31 and 32 of player's current inventory to blue stained glass pane named "&6Zdrapka" with lore "&7Zdrap, używając &aLPM!"


on inventory click:
	name of player's current inventory is "&2&lMC&6&lSquare&f&l.pl &8&l| &6&lZDRAPKI &8&l|"
	clicked inventory is not player's inventory
	cancel event
	type of clicked slot is blue stained glass pane
	if amount of blue stained glass pane in player's current inventory > 6:
		set {_it} to "%random element out of {prize::*}%" parsed as itemtype
		set {_am} to random integer between 1 and 5
		set slot (index of clicked slot) of player's current inventory to {_am} of {_it}
		add {_am} of {_it} to player's inventory
		stop
	close player's inventory

 

Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/#findComment-294777
Udostępnij na innych stronach

  • 0
16 minut temu, CoFFeIN04 napisał:

Dobra, czyściło ekwipunek bo zamiast close dałem clear XD

tutaj gotowy kod, który został przeze mnie przetestowany i działa:


options:
	item1: dirt
	item2: stone
	item3: diamond
	item4: emerald
	item5: obsidian
	item6: chest
	item7: sand
	item8: sandstone
	item9: diamond

on load:
	set {prize::*} to {@item1}, {@item2}, {@item3}, {@item4}, {@item5}, {@item6}, {@item7}, {@item8} and {@item9}

command /zdrapka [<text>]:
	trigger:
		open chest inventory named "&2&lMC&6&lSquare&f&l.pl &8&l| &6&lZDRAPKI &8&l|" with 5 rows to player
		set slot (integers from 0 to 9), 17, 18, 26, 27, (integers from 35 to 45) of player's current inventory to gray stained glass pane named "" with lore ""
		set slot 10,11,15,16,19,20,24,25,28,29,33 and 34 of player's current inventory to white stained glass pane named "" with lore ""
		set slot 12,13,14,21,22,23,30,31 and 32 of player's current inventory to blue stained glass pane named "&6Zdrapka" with lore "&7Zdrap, używając &aLPM!"


on inventory click:
	name of player's current inventory is "&2&lMC&6&lSquare&f&l.pl &8&l| &6&lZDRAPKI &8&l|"
	clicked inventory is not player's inventory
	cancel event
	type of clicked slot is blue stained glass pane
	if amount of blue stained glass pane in player's current inventory > 6:
		set {_it} to "%random element out of {prize::*}%" parsed as itemtype
		set {_am} to random integer between 1 and 5
		set slot (index of clicked slot) of player's current inventory to {_am} of {_it}
		add {_am} of {_it} to player's inventory
		stop
	close player's inventory

 

Super! Dzięki wielkie, a takie pytanie, jak na to nałożyc cooldown?

Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/#findComment-294781
Udostępnij na innych stronach

  • 0
2 minuty temu, CoFFeIN04 napisał:

na komendę zdrapka? 

dodajesz:


	cooldown: 1 hour
	cooldown message: &cMusisz odczekac jeszcze &e%remaining time% &cprzed nastepnym uzyciem!

przed trigger:

Dzięki za pomoc leci +

Odnośnik do komentarza
https://skript.pl/temat/46840-zdrapki-na-3-itemy/#findComment-294783
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ę...