Skocz do zawartości
  • 0

1.5.2 SKLEP NPC


Grovciu

Pytanie

Witam czy umiał by ktoś zrobić taki skrypt ze pod komenda /npcpostaw powstaje wieśniak taki jak z jajka w regenerowanych miastach. Gdy klikne prawym to jest gui i tam mozna dodac item. Możecie zrobić ze w skrypcie trzeba dodać dany item to ja se dodam chodzi mi oto ze cene nazwe i enchant no i jeszcze ta bron co mozna kupić.

Na przykład dodaje item jakiś np Diamentowy Helm o nazwie Demoniczny Diamentowy Helm i gdy najadę myszką na niego to pisze w 1 linijce nazwa danego itemu , w drugiej linijce enchant a w trzeciej Cena . Jeśli ktoś nie wie o co mi chodzi to proszę wejść na serwer S2.craftboard.pl tam jest taki npc to nie jest reklama serwera tylko jak by ktoś nie wiedział.

Wiem że to tak chaotycznie napisane ale nwm jak to inaczej napisać .

Przypominam to na wersje 1.5.2 minecraft. Z góry dzięki.

 

Odnośnik do komentarza
https://skript.pl/temat/18587-152-sklep-npc/
Udostępnij na innych stronach

4 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

command /usun:
	trigger:
		clear {sklepy::*}
		set {_} to location of player
	
every 1 tick:
	loop {sklepy::*}:
		loop all entities in radius 3 around block at loop-value:
			if name of loop-entity is "%loop-index%":
				teleport loop-entity to block at loop-value
on damage:
	if victim is villager:
		loop {sklepy::*}:
			if loop-value is location of block at location at victim:
				cancel event
command /npc [<text>] [<text>]:
	trigger:
		if player is op:
			if arg-1 is "stworz":
				if block under player is not air:
					spawn villager at location of block at location of player
					apply slowness 1000 to last spawned entity for 100 days
					set {_} to size of {sklepy::*}
					add 1 to {_}
					set name of last spawned entity to "sklep%{_}%"
					set {sklepy::sklep%{_}%} to location of block at location of player
					delete trades of last spawned entity
			if arg-1 is "usun":
				if arg-2 is set:
					loop all entities in radius 10 around player:
						if name of loop-entity is "%arg-2%":
							clear {sklepy::%arg-2%}
							kill loop-entity
							send "&2Usunieto sklep o nazwie %arg-2%"
							exit loop
on rightclick on villager:
	if player is sneaking:
		set {edytowanie::%player%} to true
		loop {sklepy::*}:
			if location of block at location of event-entity is loop-value:
				cancel event
				open chest with 3 rows named "%name of event-entity%" to player
				wait 1 tick 
				loop 8 times:
					clear {_trade}
					clear {_trade1}
					clear {_trade2}
					clear {_trade3}
					set {_trade} to loop-number offer of clicked entity
					if {_trade} is set:
						set {_trade1} to first item of {_trade} 
						set {_trade2} to second item of {_trade} 
						set {_trade3} to third item of {_trade} 
						set slot loop-number -1 of player's current inventory to {_trade1}
						set slot loop-number +8 of player's current inventory to {_trade2}
						set slot loop-number +17 of player's current inventory to {_trade3}
				format slot 8 of player with anvil named "&6Zmien nazwe" to close then run "zmiennazwe %player% %name of event-entity%"
				format slot 26 of player with red wool named "&cUsun villagera" to close then run [execute player command "npc usun %name of event-entity%"]
on inventory close:
	if {edytowanie::%player%} is true:
		loop {sklepy::*}:
			if inventory name of player's current inventory is "%loop-index%":
				loop all entities in radius 10 around player:
					if name of loop-entity is "%loop-index%":
						loop 8 times:
							clear {_next}
							set {_trade1} to slot loop-number -1 of player's current inventory
							set {_trade2} to slot loop-number +8 of player's current inventory
							set {_trade3} to slot loop-number +17 of player's current inventory
							delete trades of loop-entity
							if {_trade1} is not air:
								if {_trade2} is not air:
									if {_trade3} is not air:
										set {_t%loop-number%} to {_trade1} and {_trade2} for {_trade3} with 9999999999 max uses
										set {_next} to 1 
							if {_next} is not set:
								if {_trade1} is not air:
									if {_trade2} is air:
										if {_trade3} is not air:
											set {_t%loop-number%} to {_trade1} for {_trade3} with 9999999999 max uses
						loop 8 times:
							add {_t%loop-number%} to trades of loop-entity
							
		clear {edytowanie::%player%}
command /zmiennazwe [<player>] [<text>]:
	executable by: console
	trigger:
		set {zmiananazwy::%player-arg%} to "%arg-2%"
		send "&6Napisz nowa nazwe sklepu na chacie" to player-arg
on chat:
	if {zmiananazwy::%player%} is set:
		loop all entities in radius 10 around player:
			if name of loop-entity is "%{zmiananazwy::%player%}%":
				set name of loop-entity to "%message%"
				exit loop
		loop {sklepy::*}:
			if {zmiananazwy::%player%} is loop-index:
				set {_} to {sklepy::%loop-index%}
				clear {sklepy::%loop-index%}
				set {sklepy::%message%} to {_}
				clear {zmiananazwy::%player%}
				cancel event
				send "&2Zmieniono nazwe na: %message%"	
command /wiesz [<text>] [<text>]:
	trigger:
		set name of player's tool to arg-1
		set lore of player's tool to arg-2

proszę trochę nad tym siedziałem wiec liczę na plusa a wiec tak:

1 /npc stworz ---- tworzy NPC.

2 klikamy na niego PPM z shiftem.

3 Otwiera nam się GUI do edytowania sklepu.

4 Nazwę zmieniamy kowadlem a usuwamy go czerwoną wełną.

5 W nazwach możemy używać kolorów z bukkita &6,&3,&l,&k itd.

6.1 Edytowanie itemów do sprzedaży wygląda tak https://zapodaj.net/ddf4e82276e22.png.html

6.2 A efekt tak https://zapodaj.net/85a0eb35412e2.png.html

7 Można dodać 8 tradów

8.1 można także dodać tylko 1 item do wymiany w taki sposób https://zapodaj.net/93b21c26b2546.png.html

8.2 A efekt tak https://zapodaj.net/81672e9004413.png.html

9 Jeśli nie włożymy itemów poprawnie znikną więc uwaga

Myślę że pomogłem jedyne co proszę w zamian to kilka plusików :v

Odnośnik do komentarza
https://skript.pl/temat/18587-152-sklep-npc/#findComment-126962
Udostępnij na innych stronach

  • 0
Dnia 20.05.2017 o 14:19, kaol48s napisał:

@NoobLenny ja wiem są nawet 2 ale @Grovciu prosił o skript

PS: plugin na to to : shopkeeper albo villagershop

Chodzi mo to ze jest Villager i można tam dodać item i pisze nazwe opis za ile mozna kupic $

 

Odnośnik do komentarza
https://skript.pl/temat/18587-152-sklep-npc/#findComment-127577
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ę...