Skocz do zawartości
  • 0

Edycja skryptu


Tishday
 Udostępnij

Pytanie

Witam, mam skrypt na anty-logout, trochę sam edytowałem, ale nie wiele. Potrzebuje aby z 10 sekund, zrobiły się 30. I żeby graczy z permisją "pvp.bypass" anty-logout nie dotyczył. Z góry dziękuje!

 

variables:
        {pvp.%player%.time} = 0
       
options:
        tag: &9&lDipp&f&lson &8»
       
on command:
        if {pvp.%player%.time} >= 1:
                cancel event
                send "{@tag} &cPisanie komend podczas PvP jest ZABLOKOWANE" to sender
               
on damage:
        if attacker is player:
                if victim is player:
                        set {pvp.%attacker%.time} to 12
                        set {pvp.%victim%.time} to 12
       
on disconnect:
        if {pvp.%player%.time} >= 1:
                broadcast "{@tag} &cGracz %player% wylogowal sie podczas walki!"
                kill player
                          
on death:
        set {pvp.%victim%.time} to 0
       
every second:
        loop all players:
                add -1 to {pvp.%loop-player%.time}
                if {pvp.%loop-player%.time} > 0:
                        if {pvp.%loop-player%.time} > 1:
                                if {pvp.%loop-player%.time} > 2:
                                        if {pvp.%loop-player%.time} > 3:
                                                if {pvp.%loop-player%.time} > 4:
                                                        if {pvp.%loop-player%.time} > 5:
                                                                if {pvp.%loop-player%.time} > 6:
                                                                        if {pvp.%loop-player%.time} > 7:
                                                                                if {pvp.%loop-player%.time} > 8:
                                                                                        if {pvp.%loop-player%.time} > 9:
                                                                                                if {pvp.%loop-player%.time} > 10:
                                                                                                        set action bar of loop-player to "&c&lANTYLOGUT: 10 sekund" 
                                                                                                else:
                                                                                                        set action bar of loop-player to "&c&lANTYLOGUT: 9 sekund"
                                                                                        else:
                                                                                                set action bar of loop-player to "&c&lANTYLOGUT: 8 sekund"
                                                                                else:
                                                                                        set action bar of loop-player to "&c&lANTYLOGUT: 7 sekund"
                                                                        else:
                                                                                set action bar of loop-player to "&c&lANTYLOGUT: 6 sekund"
                                                                else:
                                                                        set action bar of loop-player to "&c&lANTYLOGUT: 5 sekund"
                                                        else:
                                                                set action bar of loop-player to "&c&lANTYLOGUT: 4 sekund"
                                                else:
                                                        set action bar of loop-player to "&c&lANTYLOGUT: 3 sekund"
                                        else:
                                                set action bar of loop-player to "&c&lANTYLOGUT: 2 sekund"
                                else:
                                        set action bar of loop-player to "&c&lANTYLOGUT: 1 sekund"
                        else:
                                set action bar of loop-player to "&a&lANTYLOGUT: Mozesz sie wylogowac"

on right click on ender chest:
	if {pvp.%player%.time} >= 1:
		cancel event
		send "{@tag} &cEnderchest podczas walki zablokowany!" to the player
		stop

 

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

11 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
9 minut temu, Kraftowy napisał:
variables:
        {pvp.%player%.time} = 0
       
options:
        tag: &9&lDipp&f&lson &8»
       
on command:
        if {pvp.%player%.time} >= 1:
                cancel event
                send "{@tag} &cPisanie komend podczas PvP jest ZABLOKOWANE" to sender
               
on damage:
        if attacker is player:
                if victim is player:
                    if attacker has permission "pvp.bypass":
                        stop #ewentualnie jesli nie chcesz zeby byly obrazenia to cancel event
                    else:
                        if victim has permission "pvp.bypass":
                            stop  #ewentualnie jesli nie chcesz zeby byly obrazenia to cancel event 
                        else:
                            set {pvp.%attacker%.time} to 32
                            set {pvp.%victim%.time} to 32
       
on disconnect:
        if {pvp.%player%.time} >= 1:
            if player has permission "pvp.bypass":
                stop
            else:
                broadcast "{@tag} &cGracz %player% wylogowal sie podczas walki!"
                kill player
                          
on death:
        set {pvp.%victim%.time} to 0
       
every second:
        loop all players:
                add -1 to {pvp.%loop-player%.time}
                if {pvp.%loop-player%.time} > 0:
                        if {pvp.%loop-player%.time} > 1:
                                if {pvp.%loop-player%.time} > 2:
                                        if {pvp.%loop-player%.time} > 3:
                                                if {pvp.%loop-player%.time} > 4:
                                                        if {pvp.%loop-player%.time} > 5:
                                                                if {pvp.%loop-player%.time} > 6:
                                                                        if {pvp.%loop-player%.time} > 7:
                                                                                if {pvp.%loop-player%.time} > 8:
                                                                                        if {pvp.%loop-player%.time} > 9:
                                                                                                if {pvp.%loop-player%.time} > 10:
                                                                                                        set action bar of loop-player to "&c&lANTYLOGUT: 10 sekund" 
                                                                                                else:
                                                                                                        set action bar of loop-player to "&c&lANTYLOGUT: 9 sekund"
                                                                                        else:
                                                                                                set action bar of loop-player to "&c&lANTYLOGUT: 8 sekund"
                                                                                else:
                                                                                        set action bar of loop-player to "&c&lANTYLOGUT: 7 sekund"
                                                                        else:
                                                                                set action bar of loop-player to "&c&lANTYLOGUT: 6 sekund"
                                                                else:
                                                                        set action bar of loop-player to "&c&lANTYLOGUT: 5 sekund"
                                                        else:
                                                                set action bar of loop-player to "&c&lANTYLOGUT: 4 sekund"
                                                else:
                                                        set action bar of loop-player to "&c&lANTYLOGUT: 3 sekund"
                                        else:
                                                set action bar of loop-player to "&c&lANTYLOGUT: 2 sekund"
                                else:
                                        set action bar of loop-player to "&c&lANTYLOGUT: 1 sekund"
                        else:
                                set action bar of loop-player to "&a&lANTYLOGUT: Mozesz sie wylogowac"

on right click on ender chest:
	if {pvp.%player%.time} >= 1:
		cancel event
		send "{@tag} &cEnderchest podczas walki zablokowany!" to the player
		stop

Nie sprawdzałem ale powinno być.

 

//Edit jeszcze chwile bedzie w pelni

Może to problem jakiegoś pluginu, którego nie mam, nie wiem. Już błędy.

 
[19:15:52 ERROR]: indentation error: expected 24 spaces, but found 20 spaces (combat.sk, line 15: if attacker has permission "pvp.bypass":')
[19:15:52 ERROR]: indentation error: expected 24 spaces, but found 20 spaces (combat.sk, line 17: else:')
[19:15:52 ERROR]: indentation error: expected 32 spaces, but found 28 spaces (combat.sk, line 19: stop#ewentualnie jesli nie chcesz zeby byly obrazenia to cancel event')
[19:15:52 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (combat.sk, line 18: if victim has permission "pvp.bypass":')
[19:15:52 ERROR]: indentation error: expected 32 spaces, but found 28 spaces (combat.sk, line 21: set {pvp.%attacker%.time} to 32')
[19:15:52 ERROR]: indentation error: expected 32 spaces, but found 28 spaces (combat.sk, line 22: set {pvp.%victim%.time} to 32')
[19:15:52 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (combat.sk, line 20: else:')
[19:15:52 ERROR]: indentation error: expected 16 spaces, but found 12 spaces (combat.sk, line 26: if player has permission "pvp.bypass":')
[19:15:52 ERROR]: indentation error: expected 16 spaces, but found 12 spaces (combat.sk, line 28: else:')
[19:15:52 INFO]: [Skript] Encountered 7 errors while reloading combat.sk!
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@Tishday źle wytabowany

 

Masz poprawiłem jeszcze błąd i powinno być ok:
 

variables:
	{pvp.%player%.time} = 0
       
options:
	tag: &9&lDipp&f&lson &8»
       
on command:
	if {pvp.%player%.time} >= 1:
		cancel event
		send "{@tag} &cPisanie komend podczas PvP jest ZABLOKOWANE" to sender
               
on damage:
	if attacker is player:
		if victim is player:
			if attacker has permission "pvp.bypass":
				stop #ewentualnie jesli nie chcesz zeby byly obrazenia to cancel event
			else:
				if victim has permission "pvp.bypass":
					stop  #ewentualnie jesli nie chcesz zeby byly obrazenia to cancel event 
				else:
					set {pvp.%attacker%.time} to 32
					set {pvp.%victim%.time} to 32
       
on disconnect:
	if {pvp.%player%.time} >= 1:
		if player has permission "pvp.bypass":
			stop
		else:
			broadcast "{@tag} &cGracz %player% wylogowal sie podczas walki!"
			kill player
                          
on death:
	set {pvp.%victim%.time} to 0
       
every second:
	loop all players:
		add -1 to {pvp.%loop-player%.time}
		if {pvp.%loop-player%.time} is set:
			if {pvp.%loop-player%.time} is not 1:
				set action bar of loop-player to "&c&lANTYLOGUT: %{pvp.%loop-player%.time}% sekund"                                                                          
			else:
				if {pvp.%player%.time} = 1:
					set action bar of loop-player to "&a&lANTYLOGUT: Mozesz sie wylogowac"
					set {pvp.%loop-player%.time} to 0

on right click on ender chest:
	if {pvp.%player%.time} >= 1:
		cancel event
		send "{@tag} &cEnderchest podczas walki zablokowany!" to the player
		stop

Ewentualnie sam wytabuj sobie bo widzę że |code| nie chce działać, miesza taby

 

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

  • 0

Hmm...

 
[19:22:23 INFO]: [Skript] Reloading combat.sk...
[19:22:23 ERROR]: indentation error: expected 4 tabs, but found 3 tabs (combat.sk, line 37: add -1 to {pvp.%loop-player%.time}')
[19:22:23 ERROR]: indentation error: expected 4 tabs, but found 3 tabs (combat.sk, line 38: if {pvp.%loop-player%.time} is set:')
[19:22:23 ERROR]: indentation error: expected 6 tabs, but found 5 tabs (combat.sk, line 40: set action bar of loop-player to "&c&lANTYLOGUT: %{pvp.%loop-player%.time}% sekund"')
[19:22:23 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (combat.sk, line 39: if {pvp.%loop-player%.time} is not 1:')
[19:22:23 ERROR]: indentation error: expected 6 tabs, but found 5 tabs (combat.sk, line 42: if {pvp.%player%.time} = 1:')
[19:22:23 INFO]: [Skript] Encountered 4 errors while reloading combat.sk!
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Dobra, wytabowałem. Ale jak już robie reload skryptu, na action barze wyskakuje "ANTYLOGOUT: -1623" i tak liczy i liczy. Dodam że wersja minecraft to 1.12.2.

 
[19:29:55 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (combat.sk, line 38: if {pvp.%loop-player%.time} is set:')
[19:29:55 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (combat.sk, line 42: if {pvp.%player%.time} = 1:')
[19:29:55 ERROR]: There's no world in a periodic event if no world is given in the event (e.g. like 'every hour in "world"') (combat.sk, line 42: if {pvp.%player%.time} = 1:')
[19:29:55 INFO]: [Skript] Encountered 1 error while reloading combat.sk!
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

variables:
	{pvp.%player%.time} = 0
       
options:
	tag: &9&lDipp&f&lson &8»
       
on command:
	if {pvp.%player%.time} >= 1:
		cancel event
		send "{@tag} &cPisanie komend podczas PvP jest ZABLOKOWANE" to sender
               
on damage:
	if attacker is player:
		if victim is player:
			if attacker has permission "pvp.bypass":
				stop #ewentualnie jesli nie chcesz zeby byly obrazenia to cancel event
			else:
				if victim has permission "pvp.bypass":
					stop  #ewentualnie jesli nie chcesz zeby byly obrazenia to cancel event 
				else:
					set {pvp.%attacker%.time} to 32
					set {pvp.%victim%.time} to 32
       
on disconnect:
	if {pvp.%player%.time} >= 1:
		if player has permission "pvp.bypass":
			stop
		else:
			broadcast "{@tag} &cGracz %player% wylogowal sie podczas walki!"
			kill player
                          
on death:
	set {pvp.%victim%.time} to 0
       
every second:
	loop all players:
		add -1 to {pvp.%loop-player%.time}
		if {pvp.%loop-player%.time} is set
			if {pvp.%loop-player%.time} is not 1:
				set action bar of loop-player to "&c&lANTYLOGUT: %{pvp.%loop-player%.time}% sekund"                                                                          
			else:
				if {pvp.%player%.time} = 1
					set action bar of loop-player to "&a&lANTYLOGUT: Mozesz sie wylogowac"
					set {pvp.%loop-player%.time} to 0

on right click on ender chest:
	if {pvp.%player%.time} >= 1:
		cancel event
		send "{@tag} &cEnderchest podczas walki zablokowany!" to the player
		stop

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ę...