Skocz do zawartości
  • 0

Skrypt na hajs za zabójstwa


Pytanie

Witam szukam skryptu w GUI że np zabijasz Gracza. Dostajesz 1 grosz i jest jakaś szansa że dostaniesz więcej i do tego GUI np /hajs i pokazuje ci stan konta i najlepiej plik yml żeby można było sterować stanem konta w skrypcie 

Odnośnik do komentarza
https://skript.pl/temat/54230-skrypt-na-hajs-za-zab%C3%B3jstwa/
Udostępnij na innych stronach

4 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Wersja z hajsem z ekonomii serwera (wymagane vault oraz plugin ekonomii np essentialssx):

 

Options:
	# ####NAZWA  GUI:
	gui: "&f&lHajsy"
	# ###ILE HAJSU ZA ZABICIE?
	hajs: 10
command /hajs:
	trigger:
		set {_gui} to chest inventory with 1 rows named {@gui}
		set slot 0 of {_gui} to player's head named "&e&l%player's name% " with lore "&6Stan konta: %{player's balance}%"
		set slot 2 of {_gui} to {lastVictim::%player%}'s head named "&6Ostatnie zabójstwo" with lore "&e&l%{lastVictim::%player%}'s name% "
		set slot 4 of {_gui} to {lastDeath::%victim%}'s head named "&6Ostatnia Śmierć" with lore "&e&l%{lastDeath::%victim%}'s name% "
		set slot 8 of {_gui} to barrier named "&4Wyjdź"
		open {_gui} to player
		
on death:
	if attacker is player:
		if victim is player:
			add {@hajs} to attacker's balance
			set {lastVictim::%attacker%} to victim
			set {lastDeath::%victim%} to attacker

wersja z custom hajsem trzymanym w skript (wystarczy sam najnowszy skript bez addonów):

 

Options:
	# ####NAZWA  GUI:
	gui: "&f&lHajsy"
	# ###ILE HAJSU ZA ZABICIE?
	hajs: 10
command /hajs:
	trigger:
		set {_gui} to chest inventory with 1 rows named {@gui}
		set slot 0 of {_gui} to player's head named "&e&l%player's name% " with lore "&6Stan konta: %{balance::%player%}%"
		set slot 2 of {_gui} to {lastVictim::%player%}'s head named "&6Ostatnie zabójstwo" with lore "&e&l%{lastVictim::%player%}'s name% "
		set slot 4 of {_gui} to {lastDeath::%victim%}'s head named "&6Ostatnia Śmierć" with lore "&e&l%{lastDeath::%victim%}'s name% "
		set slot 8 of {_gui} to barrier named "&4Wyjdź"
		open {_gui} to player
		
on death:
	if attacker is player:
		if victim is player:
			add {@hajs} to {balance::%attacker%}
			set {lastVictim::%attacker%} to victim
			set {lastDeath::%victim%} to attacker


on join:
	if {balance::%player%} is not set:
		set {balance::%player%} to 0


full opcja- custom waluta plus komendy do dodwania setowania lub odejmowania hajsu plus zapis do YAML (wymagany Skript w najnowszej wersji oraz addon SkQuery)
 

Options:
	# ####NAZWA  GUI:
	gui: "&f&lHajsy"
	# ###ILE HAJSU ZA ZABICIE?
	hajs: 10
	# ### NAZWA WALUTY:
	hajsNazwa: "$"
	
command /hajs:
	trigger:
		set {balance::%player%} to yaml value "balance.%player's name%" from file "plugins/Skript/scripts/hajs_db.yml"
		set {_gui} to chest inventory with 1 rows named {@gui}
		set slot 0 of {_gui} to player's head named "&e&l%player's name% " with lore "&6Stan konta: %{balance::%player%}%%{@hajsNazwa}%"
		set slot 2 of {_gui} to {lastVictim::%player%}'s head named "&6Ostatnie zabójstwo" with lore "&e&l%{lastVictim::%player%}'s name% "
		set slot 4 of {_gui} to {lastDeath::%victim%}'s head named "&6Ostatnia Śmierć" with lore "&e&l%{lastDeath::%victim%}'s name% "
		set slot 8 of {_gui} to barrier named "&4Wyjdź"
		open {_gui} to player

command /adminhajs [<text>] [<offline player>] [<number>]:
	permission: hajs.admin
	trigger:
		arg 1 is "add":
			arg 2 is set:
				arg 3 is set:
					set {balance::%arg 2%} to {balance::%arg 2%} + arg 3
					set yaml value "balance.%arg 3%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%arg 2%}
					send "&6Do Twojego konta dodano &6&l%arg 3%&6&l%{@hajsNazwa}%" to arg 2
					send "&6Do konta %arg 2% dodano &6&l%arg 3%&6&l%{@hajsNazwa}%" to player				
					stop
				send "&cNie podano kwoty!" to player
				stop
			send "&cNie podano nicku gracza!" to player
		arg 1 is "remove":
			arg 2 is set:
				arg 3 is set:
					set {balance::%arg 2%} to {balance::%arg 2%} - arg 3
					set yaml value "balance.%arg 3%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%arg 2%}
					send "&6Z Twojego konta odjęto &6&l%arg 3%&6&l%{@hajsNazwa}%" to arg 2
					send "&6Z konta %arg 2% odjęto &6&l%arg 3%&6&l%{@hajsNazwa}%" to player				
					stop
				send "&cNie podano kwoty!" to player
				stop
			send "&cNie podano nicku gracza!" to player
		arg 1 is "set":
			arg 2 is set:
				arg 3 is set:
					set {balance::%arg 2%} to arg 3
					set yaml value "balance.%arg 3%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%arg 2%}
					send "&6Twoje konto usawiono na &6&l%arg 3%&6&l%{@hajsNazwa}%" to arg 2
					send "&6Ustawiono konto gracza %arg 2% na  &6&l%arg 3%&6&l%{@hajsNazwa}%" to player				
					stop
				send "&cNie podano kwoty!" to player
				stop
			send "&cNie podano nicku gracza!" to player
			
					
					
on death:
	if attacker is player:
		if victim is player:
			add {@hajs} to {balance::%attacker%}
			set {lastVictim::%attacker%} to victim
			set {lastDeath::%victim%} to attacker
			set yaml value "balance.%attacker's name%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%attacker%}


on join:
	set {balance::%player%} to yaml value "balance.%player's name%" from file "plugins/Skript/scripts/hajs_db.yml"
	if {balance::%player%} is not set:
		set {balance::%player%} to 0
		set yaml value "balance.%player's name%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%player%}
			



z góry pisze że nie testowalem ale mało w czym tu sie da pomylić więc powinno działać :P

Edytowane przez Saanjuk
Odnośnik do komentarza
https://skript.pl/temat/54230-skrypt-na-hajs-za-zab%C3%B3jstwa/#findComment-329294
Udostępnij na innych stronach

  • 0
Options:
	# ####NAZWA  GUI:
	gui: "&f&lHajsy"
	# ###ILE HAJSU ZA ZABICIE?
	hajs: 10
	# ### NAZWA WALUTY:
	hajsNazwa: "$"
	
command /hajs:
	trigger:
		
		set {_gui} to chest inventory with 1 rows named {@gui}
		set slot 0 of {_gui} to player's head named "&e&l%player's name% " with lore "&6Stan konta: %{balance::%player%}%%{@hajsNazwa}%"
		if {lastVictim::%player%} is not set:
			set slot 2 of {_gui} to skull of ("Questions" parsed as offlineplayer) named "&6&lOstatnie zabójstwo:" with lore "&c&lBrak"
		else:
			set slot 2 of {_gui} to {lastVictim::%player%}'s head named "&6&lOstatnie zabójstwo:" with lore "&e&l%{lastVictim::%player%}'s name% "
		if {lastDeath::%player%} is not set:
			set slot 4 of {_gui} to skull of ("Questions" parsed as offlineplayer) named "&6&lOstatnia Śmierć:" with lore "&c&lBrak"
		else:
			set slot 4 of {_gui} to {lastDeath::%player%}'s head named "6&lOstatnia Śmierć:" with lore "&e&l%{lastDeath::%player%}'s name% "
		set slot 8 of {_gui} to barrier named "&4Wyjdź"
		open {_gui} to player

command /adminhajs [<text>] [<offline player>] [<number>]:
	permission: hajs.admin
	trigger:
		arg 1 is "add":
			arg 2 is set:
				arg 3 is set:
					set {balance::%arg 2%} to {balance::%arg 2%} + arg 3
					set yaml value "balance.%arg 3%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%arg 2%}
					send "&6Do Twojego konta dodano &6&l%arg 3%&6&l%{@hajsNazwa}%" to arg 2
					send "&6Do konta %arg 2% dodano &6&l%arg 3%&6&l%{@hajsNazwa}%" to player				
					stop
				send "&cNie podano kwoty!" to player
				stop
			send "&cNie podano nicku gracza!" to player
		arg 1 is "remove":
			arg 2 is set:
				arg 3 is set:
					set {balance::%arg 2%} to {balance::%arg 2%} - arg 3
					set yaml value "balance.%arg 3%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%arg 2%}
					send "&6Z Twojego konta odjęto &6&l%arg 3%&6&l%{@hajsNazwa}%" to arg 2
					send "&6Z konta %arg 2% odjęto &6&l%arg 3%&6&l%{@hajsNazwa}%" to player				
					stop
				send "&cNie podano kwoty!" to player
				stop
			send "&cNie podano nicku gracza!" to player
		arg 1 is "set":
			arg 2 is set:
				arg 3 is set:
					set {balance::%arg 2%} to arg 3
					set yaml value "balance.%arg 3%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%arg 2%}
					send "&6Z Twojego konta odjęto &6&l%arg 3%&6&l%{@hajsNazwa}%" to arg 2
					send "&6Z konta %arg 2% odjęto &6&l%arg 3%&6&l%{@hajsNazwa}%" to player				
					stop
				send "&cNie podano kwoty!" to player
				stop
			send "&cNie podano nicku gracza!" to player
			
					
					
on death:
	if attacker is player:
		if victim is player:
			add {@hajs} to {balance::%attacker%}
			set {lastVictim::%attacker%} to victim
			set {lastDeath::%victim%} to attacker
			set yaml value "balance.%attacker's name%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%attacker%}


on join:
	set {balance::%player%} to yaml value "balance.%player's name%" from file "plugins/Skript/scripts/hajs_db.yml"
	if {balance::%player%} is not set:
		set {balance::%player%} to 0
		set yaml value "balance.%player's name%" from file "plugins/Skript/scripts/hajs_db.yml" to {balance::%player%}
			

jedynym minusem jest to że skript twierdzi ze nie może zapisać trwale zmiennych lastvictim oraz lastdeath i znikną po resecie serwera jeżeli bardzo ci to przeszkadza mogę zapisywać te wartości w YAML i wtedy problem zniknie

 

Edytowane przez Saanjuk
Odnośnik do komentarza
https://skript.pl/temat/54230-skrypt-na-hajs-za-zab%C3%B3jstwa/#findComment-329351
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ę...