Skocz do zawartości
  • 0

WINDA


Kupeczka
 Udostępnij

Pytanie

Siemka. Mozecie mi zrobic skrypt na winde? Wyglada to tak:

- Craftujesz winde o nazwie "Winda"

- Kladziesz ja i jak klikniesz spacje to tepa cie na gore gdzie jest polozona druga "winda" (co 10 kratek). 

- Jak klikniesz shift To tepa ci na dol.

- Po zniszczeniu wypada "winda".

Z gory dzieki :)

Wersja 1.9+

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

9 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
comand /usun winde:
	trigger:
		remove {pozycja.winda.dol::%player%}
		remove {pozycja.winda.gora::%player%}
on place of stone:
	if {pozycja.winda.dol::%player%} is set:
		if {pozycja.winda.gora} is set:
			send "&7Masz ustawioną już windę, użyj &3/usun winde &7aby na nowo ustawić kolejną"
		else:
			set {pozycja.winda.gora::%player%} to position of event-block
			send "&7Górna część windy ustawiona na pozycji "%{pozycja.winda.gora::%player%}%"
			stop
	else:
		set {pozycja.winda.gora::%player%} to position of event-block
		send "&7Dolna część windy ustawiona na pozycji "%{pozycja.winda.gora::%player%}%"

on any movement:
	if player is sneaking:
		if block under player is stone:
			if position of event-block is {pozycja.winda.dol::%player%}:
				teleport player to {pozycja.winda.gora::%player%}
			else:
				if position of event-block is {pozycja.winda.gora::%player%}:
					teleport player to {pozycja.winda.dol::%player%}

masz, coś takiego powinno pomóc, zmień tylko blok do ustawiania windy bo dałem kamień zwykły.
Winda teleportuje tylko podczas skradania się

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
9 godzin temu, JPablo napisał:
comand /usun winde:
	trigger:
		remove {pozycja.winda.dol::%player%}
		remove {pozycja.winda.gora::%player%}
on place of stone:
	if {pozycja.winda.dol::%player%} is set:
		if {pozycja.winda.gora} is set:
			send "&7Masz ustawioną już windę, użyj &3/usun winde &7aby na nowo ustawić kolejną"
		else:
			set {pozycja.winda.gora::%player%} to position of event-block
			send "&7Górna część windy ustawiona na pozycji "%{pozycja.winda.gora::%player%}%"
			stop
	else:
		set {pozycja.winda.gora::%player%} to position of event-block
		send "&7Dolna część windy ustawiona na pozycji "%{pozycja.winda.gora::%player%}%"

on any movement:
	if player is sneaking:
		if block under player is stone:
			if position of event-block is {pozycja.winda.dol::%player%}:
				teleport player to {pozycja.winda.gora::%player%}
			else:
				if position of event-block is {pozycja.winda.gora::%player%}:
					teleport player to {pozycja.winda.dol::%player%}

masz, coś takiego powinno pomóc, zmień tylko blok do ustawiania windy bo dałem kamień zwykły.
Winda teleportuje tylko podczas skradania się

Ciekawe :) Ale raczej o cos innego mi chodziło.

• Craftujesz np. Dispenser o nazwie WINDA, potem Kladzisz go zeby sie przeteleportowac musisz miec inna winde o 10 kratek wyzej i nacisnac SPACJE (skok) A zeby na dol to shift (skradanie). Niszczac dostajesz Dispenser o nazwie WINDA ;)

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
on script load:
     register new shaped recipe for dispenser named "Winda" using stone, stone, stone, stone, stone, stone, stone, stone, stone,

W miejsce "stone" wstaw odpowiadający ci przedmiot.

Dodaj go do w/w skryptu i usuń tylko komendy, zamień:

on place of stone:

na

on place of "Winda":	

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
Spoiler
#winda
function isWinda(loc: location, t: text) :: location:
	if {_t} is "sneak":
		loop {winda::*}:
			if "%loop-value%" is "%{_loc}%":
				set {_y} to true
				exit loop
		if {_y} is set:
			loop {winda::*}:
				if x-location of {_loc} is x-location of loop-value:
					if z-location of {_loc} is z-location of loop-value:
						if difference between y-location of {_loc} and y-location of loop-value is smaller than 10:
							if difference between y-location of {_loc} and y-location of loop-value is larger than 2:
								if y-location of {_loc} is larger than y-location of loop-value:
									remove difference between y-location of {_loc} and y-location of loop-value + 1 from y-location of {_loc}
									return {_loc}
	if {_t} is "jump":
		loop {winda::*}:
			if "%loop-value%" is "%{_loc}%":
				set {_y} to true
				exit loop
		if {_y} is set:
			loop {winda::*}:
				if x-location of {_loc} is x-location of loop-value:
					if z-location of {_loc} is z-location of loop-value:
						if difference between y-location of {_loc} and y-location of loop-value is smaller than 10:
							if difference between y-location of {_loc} and y-location of loop-value is larger than 2:
								if y-location of {_loc} is smaller than y-location of loop-value:
									add difference between y-location of {_loc} and y-location of loop-value + 1 to y-location of {_loc}
									return {_loc}
	if {_t} is "break":
		loop {winda::*}:
			if "%loop-value%" is "%{_loc}%":
				delete {winda::%loop-index%}
				return {_loc}
				exit loop
		
	return null
on script load:
	register new shaped recipe for black_wool named "&6Winda" using black_wool, black_wool, black_wool, black_wool, piston, black_wool, black_wool, black_wool, black_wool
on place of black_wool:
	if name of player's tool is "&6Winda":
		add location of block to {winda::*}
on sneak toggle:
	if player is sneaking:
		set {_loc} to location of block below location of player
		if block below location of player is black_wool:
			set {_l} to isWinda({_loc}, "sneak")
			if {_l} is not "<none>":
				teleport player to {_l}
on jump:
	set {_loc} to location of block below location of player
	if block below location of player is black_wool:
		set {_l} to isWinda({_loc}, "jump")
		if {_l} is not "<none>":
			teleport player to {_l}
on break:
	if event-block is black_wool:
		set {_ret} to isWinda(location of event-block, "break")
		if {_ret} is not "<none>":
			cancel event
			set event-block to air
			give black_wool named "&6Winda" to player
			stop

 

Wymagany dodatek, który posiada event on jump ! np: (WildSkript, SkMorkaz)

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
18 godzin temu, knugi napisał:
Zarejestruj się lub zaloguj, aby zobaczyć ukrytą treść! Ukryj zawartość

#winda
function isWinda(loc: location, t: text) :: location:
	if {_t} is "sneak":
		loop {winda::*}:
			if "%loop-value%" is "%{_loc}%":
				set {_y} to true
				exit loop
		if {_y} is set:
			loop {winda::*}:
				if x-location of {_loc} is x-location of loop-value:
					if z-location of {_loc} is z-location of loop-value:
						if difference between y-location of {_loc} and y-location of loop-value is smaller than 10:
							if difference between y-location of {_loc} and y-location of loop-value is larger than 2:
								if y-location of {_loc} is larger than y-location of loop-value:
									remove difference between y-location of {_loc} and y-location of loop-value + 1 from y-location of {_loc}
									return {_loc}
	if {_t} is "jump":
		loop {winda::*}:
			if "%loop-value%" is "%{_loc}%":
				set {_y} to true
				exit loop
		if {_y} is set:
			loop {winda::*}:
				if x-location of {_loc} is x-location of loop-value:
					if z-location of {_loc} is z-location of loop-value:
						if difference between y-location of {_loc} and y-location of loop-value is smaller than 10:
							if difference between y-location of {_loc} and y-location of loop-value is larger than 2:
								if y-location of {_loc} is smaller than y-location of loop-value:
									add difference between y-location of {_loc} and y-location of loop-value + 1 to y-location of {_loc}
									return {_loc}
	if {_t} is "break":
		loop {winda::*}:
			if "%loop-value%" is "%{_loc}%":
				delete {winda::%loop-index%}
				return {_loc}
				exit loop
		
	return null
on script load:
	register new shaped recipe for black_wool named "&6Winda" using black_wool, black_wool, black_wool, black_wool, piston, black_wool, black_wool, black_wool, black_wool
on place of black_wool:
	if name of player's tool is "&6Winda":
		add location of block to {winda::*}
on sneak toggle:
	if player is sneaking:
		set {_loc} to location of block below location of player
		if block below location of player is black_wool:
			set {_l} to isWinda({_loc}, "sneak")
			if {_l} is not "<none>":
				teleport player to {_l}
on jump:
	set {_loc} to location of block below location of player
	if block below location of player is black_wool:
		set {_l} to isWinda({_loc}, "jump")
		if {_l} is not "<none>":
			teleport player to {_l}
on break:
	if event-block is black_wool:
		set {_ret} to isWinda(location of event-block, "break")
		if {_ret} is not "<none>":
			cancel event
			set event-block to air
			give black_wool named "&6Winda" to player
			stop

 

Wymagany dodatek, który posiada event on jump ! np: (WildSkript, SkMorkaz)


 
[14:39:28 INFO]: [Skript] Reloading winda.sk...
[14:39:28 ERROR]: Can't understand this condition/effect: register new shaped recipe for black_wool named "&6Winda" using black_wool, black_wool, black_wool, black_wool, piston, black_wool, black_wool, black_wool, black_wool (winda.sk, line 40: register new shaped recipe for black_wool named "&6Winda" using black_wool, black_wool, black_wool, black_wool, piston, black_wool, black_wool, black_wool, black_wool')
[14:39:28 ERROR]: can't understand this event: 'on place of black_wool' (winda.sk, line 41: on place of black_wool:')
[14:39:28 ERROR]: Can't compare a block with 'black_wool' (winda.sk, line 47: if block below location of player is black_wool:')
[14:39:28 ERROR]: Can't compare a block with 'black_wool' (winda.sk, line 53: if block below location of player is black_wool:')
[14:39:28 ERROR]: Can't compare a block with 'black_wool' (winda.sk, line 58: if event-block is black_wool:')
[14:39:28 INFO]: [Skript] Encountered 5 errors while reloading winda.sk!

 

Edytowane przez Ixidi
[code]
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
2 godziny temu, knugi napisał:

zmień black_wool na dowolny blok jaki chcesz :)

Nie masz w alliasach tego bloku i wywala błedy (bo skquery raczej masz :))  

Zmienilem. Takie cos teraz jest:

[[20:46:59 WARN]: Possible name conflict of variables {winda::%loop-index%} and {winda::*} (there might be more conflicts). (winda.sk, line 34: delete {winda::%loop-index%}')]

+ nie da sie scraftowac, dalem zamiast welny stone.

 

 

 

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

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

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

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