Skocz do zawartości
  • 0

skript na banknot


shaqupl1

Pytanie

command /banknot [<integer=100>]:
	trigger:
		if arg-1 is greater than or equal to 10:
			if player's balance is greater than or equal to arg-1:
				remove arg-1 from player's balance
				if player has enough space for 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$":
					give player 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$"
				else:
					drop 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$"
					send "&aNie masz miejsca w ekwipunku, banknot wypadł na ziemię"
				send "&aWypłaciłeś &6%arg-1%&6$ &aze swojego konta!" to player
			else:
				send "&aNie masz tyle pieniędzy!"
		else:
			send "&aKwota musi być większa od 10$"
on right click:
	if player's tool is paper:
		send "papier"
		if player's tool's name is "&2Banknot":
			send "banknot"
			if player's tool's lore is "&7Wartość:":
				send "lore"
				set {_} to (substring of (line 1 of player's tool's lore) from characters 14 to (length of (line 1 of player's tool's lore) - 3)) parsed as integer
				add {_} to player's balance
				set player's tool to (item amount of player's tool - 1) of player's tool
				send "&aWpłaciłeś &6%{_}%&6$ &ana swoje konto!" to player

Generalnie banknot daje, ale po kliknieciu prawy wykonuje się do linii send "banknot" 

v02Hnmp.png

Błędów nie wywala.

 

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

6 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Poprawiona wersja:
 

command /banknot [<integer=100>]:
	trigger:
		if arg-1 is greater than or equal to 10:
			if player's balance is greater than or equal to arg-1:
				remove arg-1 from player's balance
				if player has enough space for 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$":
					give player 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$"
				else:
					drop 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$"
					send "&aNie masz miejsca w ekwipunku, banknot wypadł na ziemię"
				send "&aWypłaciłeś &6%arg-1%&6$ &aze swojego konta!" to player
			else:
				send "&aNie masz tyle pieniędzy!"
		else:
			send "&aKwota musi być większa od 10$"
on right click:
	if player's tool is paper:
		if player's tool's name is "&2Banknot":
			if player's tool's lore is "&7Wartość:":
				send "lore"
				set {_} to (substring of (line 1 of player's tool's lore) from characters 14 to (length of (line 1 of player's tool's lore) - 3)) parsed as integer
				add {_} to player's balance
				set player's tool to (item amount of player's tool - 1) of player's tool
				send "&aWpłaciłeś &6%{_}%&6$ &ana swoje konto!" to player

chyba dobrze, wydaje mi się że nie może być żadnych linijek pomiędzy if player's tool... itp itd

Odnośnik do komentarza
https://skript.pl/temat/49752-skript-na-banknot/#findComment-308634
Udostępnij na innych stronach

  • 0
27 minut temu, Kubo0208 napisał:

Poprawiona wersja:
 

command /banknot [<integer=100>]:
	trigger:
		if arg-1 is greater than or equal to 10:
			if player's balance is greater than or equal to arg-1:
				remove arg-1 from player's balance
				if player has enough space for 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$":
					give player 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$"
				else:
					drop 1 paper named "&2Banknot" with lore "&7Wartość: &a%arg-1%&a$"
					send "&aNie masz miejsca w ekwipunku, banknot wypadł na ziemię"
				send "&aWypłaciłeś &6%arg-1%&6$ &aze swojego konta!" to player
			else:
				send "&aNie masz tyle pieniędzy!"
		else:
			send "&aKwota musi być większa od 10$"
on right click:
	if player's tool is paper:
		if player's tool's name is "&2Banknot":
			if player's tool's lore is "&7Wartość:":
				send "lore"
				set {_} to (substring of (line 1 of player's tool's lore) from characters 14 to (length of (line 1 of player's tool's lore) - 3)) parsed as integer
				add {_} to player's balance
				set player's tool to (item amount of player's tool - 1) of player's tool
				send "&aWpłaciłeś &6%{_}%&6$ &ana swoje konto!" to player

chyba dobrze, wydaje mi się że nie może być żadnych linijek pomiędzy if player's tool... itp itd

Nie działa

Odnośnik do komentarza
https://skript.pl/temat/49752-skript-na-banknot/#findComment-308635
Udostępnij na innych stronach

  • 0
24 minuty temu, shaqupl1 napisał:

Nie działa

  • on right click:
    	if player's tool's lore is "&7Wartość:":
    		set {_} to (substring of (line 1 of player's tool's lore) from characters 14 to (length of (line 1 of player's tool's lore) - 3)) parsed as integer
    		add {_} to player's balance
    		set player's tool to (item amount of player's tool - 1) of player's tool
    		send "&aWpłaciłeś &6%{_}%&6$ &ana swoje konto!" to player

    może coś takkiego?

Odnośnik do komentarza
https://skript.pl/temat/49752-skript-na-banknot/#findComment-308638
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ę...