Skocz do zawartości
  • 0

Skrypt na dropienie tylko koxów i refów.


Pytanie

Rekomendowane odpowiedzi

  • 0

  

W dniu 12.08.2020 o 13:44, dojn napisał:


 

[13:44:14 WARN]: an entity cannot be saved, i.e. the contents of the variable {last::fiveseconds::attacker::%the attacked entity%} will be lost when the server stops. (kill.sk, line 7: set {last::fiveseconds::attacker::%victim%} to attacker')

 

A no tak... Daj 'on damage of player:'.

Edytowane przez xAxee
xAxee

Poprawiam cytat

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/40996-skrypt-na-dropienie-tylko-kox%C3%B3w-i-ref%C3%B3w/#findComment-255687
Udostępnij na innych stronach

  • 0
W dniu 12.08.2020 o 13:45, Kormic napisał:

A no tak... Daj 'on damage of player:'.

on load:
    clear {last::fiveseconds::attacker::*}

on damage of player:
    if damage cause is attack:
        if attacker is a player:
            set {last::fiveseconds::attacker::%victim%} to attacker
            wait 5 seconds
            clear {last::fiveseconds::attacker::%victim%}
            
on death of player:
    if damage cause is attack:
        if attacker is a player:
            loop all items in victim's inventory:
                add loop-item to {_inventory::*}
            clear drops 
            loop {_inventory::*}:
                if loop-value is golden apple or enchanted golden apple:
                    if attacker has enough space for loop-value:
                        add loop-value to attacker's inventory
                    else:
                        drop loop-value at the victim
    else if damage cause is fall:
        if {last::fiveseconds::attacker::%victim%} is set:
            loop all items in victim's inventory:
                add loop-item to {_inventory::*}
            clear drops
            loop {_inventory::*}:
                if loop-value is golden apple or enchanted golden apple:
                    if attacker has enough space for loop-value:
                        add loop-value to attacker's inventory
                    else:
                        drop loop-value at the victim
            clear {last::fiveseconds::attacker::%victim%}

 

Zrobiłem  tak i nadal ten sam warn

Edytowane przez xAxee
xAxee

Wstawiam w code

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/40996-skrypt-na-dropienie-tylko-kox%C3%B3w-i-ref%C3%B3w/#findComment-255690
Udostępnij na innych stronach

  • 0
W dniu 12.08.2020 o 13:47, dojn napisał:

on load:
    clear {last::fiveseconds::attacker::*}

on damage of player:
    if damage cause is attack:
        if attacker is a player:
            set {last::fiveseconds::attacker::%victim%} to attacker
            wait 5 seconds
            clear {last::fiveseconds::attacker::%victim%}
            
on death of player:
    if damage cause is attack:
        if attacker is a player:
            loop all items in victim's inventory:
                add loop-item to {_inventory::*}
            clear drops 
            loop {_inventory::*}:
                if loop-value is golden apple or enchanted golden apple:
                    if attacker has enough space for loop-value:
                        add loop-value to attacker's inventory
                    else:
                        drop loop-value at the victim
    else if damage cause is fall:
        if {last::fiveseconds::attacker::%victim%} is set:
            loop all items in victim's inventory:
                add loop-item to {_inventory::*}
            clear drops
            loop {_inventory::*}:
                if loop-value is golden apple or enchanted golden apple:
                    if attacker has enough space for loop-value:
                        add loop-value to attacker's inventory
                    else:
                        drop loop-value at the victim
            clear {last::fiveseconds::attacker::%victim%}

 

Zrobiłem  tak i nadal ten sam warn

Cóż, nie powinno tak być. Zresztą ta zmienna jest potrzebna na maksymalnie 5 sekund, więc nie przejmuj się tym warnem.

EDIT:

Zauważyłem błąd w skrypcie, teraz jest dobrze (warn nadal będzie):

on load:
	clear {last::fiveseconds::attacker::*}

on damage:
	if attacker is a player:
		if victim is a player:
			set {last::fiveseconds::attacker::%victim%} to attacker
			wait 5 seconds
			clear {last::fiveseconds::attacker::%victim%}
			
on death of player:
	if damage cause is attack:
		if attacker is a player:
			loop all items in victim's inventory:
				add loop-item to {_inventory::*}
			cancel drops
			loop {_inventory::*}:
				if loop-value is golden apple or enchanted golden apple:
					if attacker has enough space for loop-value:
						add loop-value to attacker's inventory
					else:
						drop loop-value at the victim
	else if damage cause is fall:
		if {last::fiveseconds::attacker::%victim%} is set:
			loop all items in victim's inventory:
				add loop-item to {_inventory::*}
			cancel drops
			loop {_inventory::*}:
				if loop-value is golden apple or enchanted golden apple:
					if {last::fiveseconds::attacker::%victim%} has enough space for loop-value:
						add loop-value to {last::fiveseconds::attacker::%victim%}'s inventory
					else:
						drop loop-value at the victim
			clear {last::fiveseconds::attacker::%victim%}

Proszę.

Edytowane przez xAxee
xAxee

Poprawiam cytat

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/40996-skrypt-na-dropienie-tylko-kox%C3%B3w-i-ref%C3%B3w/#findComment-255694
Udostępnij na innych stronach

  • 0
17 minut temu, Kormic napisał:

Cóż, nie powinno tak być. Zresztą ta zmienna jest potrzebna na maksymalnie 5 sekund, więc nie przejmuj się tym warnem.

NIe działa, zrobiłem test, kolega zdjął seta, uderzyłem go z miecza, kolega rzucił 7 pereł, czyli się zabił, miał koxy i refy w eq i nie dostałem ich. Potem kolega mnie zrzucił gdy miałem koxy i refy do otchłani na sam dół i też nie dostał

 

Odnośnik do komentarza
https://skript.pl/temat/40996-skrypt-na-dropienie-tylko-kox%C3%B3w-i-ref%C3%B3w/#findComment-255699
Udostępnij na innych stronach

  • 0
2 minuty temu, dojn napisał:

NIe działa, zrobiłem test, kolega zdjął seta, uderzyłem go z miecza, kolega rzucił 7 pereł, czyli się zabił, miał koxy i refy w eq i nie dostałem ich. Potem kolega mnie zrzucił gdy miałem koxy i refy do otchłani na sam dół i też nie dostał

 

Poprawiłem skrypt, sprawdź wyżej.

Odnośnik do komentarza
https://skript.pl/temat/40996-skrypt-na-dropienie-tylko-kox%C3%B3w-i-ref%C3%B3w/#findComment-255700
Udostępnij na innych stronach

  • 0
on damage of player:
	if atttacker is player:
		set {lastAttacker::%victim%} to atttacker
		wait 5 second
		clear {lastAttacker::%victim%}
on death of player:
	loop drops:
		if type of loop-value is not golden apple or enchanted golden apple:
			remove loop-value from drops
	if {lastAttacker::%victim%} is set:
		add drops to {lastAttacker::%victim%}
		clear drops

 

Odnośnik do komentarza
https://skript.pl/temat/40996-skrypt-na-dropienie-tylko-kox%C3%B3w-i-ref%C3%B3w/#findComment-256552
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ę...