Skocz do zawartości
  • 0

Poprawa skryptow


lizz0r

Pytanie

Siema poprawiłby mi ktoś te skrypty, w skrypcie na lvl nie ustawia expa na 0 po awansie np. dam sobie 300 expa, i mam lvl 4 i expa 300, a nie 0. W skrypcie drugim ochrona działa do ochrony 18, a chcę żeby działała do ochrony 20. @PoweredDragon Pomógłbyś Ty pisałeś te skrypty :D

Skrypt 1:

command /exp <offlineplayer=%player%> <number=10>:
	permission: exp.add
	trigger:
		set {_p} to offlineplayer-arg
		add number-arg to {exp::%{_p}%}
		{lvl::%player%} is 1:
			set {_x} to ceiling({exp::%{_p}%}/100)
			set {_y} to mod({exp::%{_p}%},100)
			{_x}==1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/100
					stop
				set {exp::%{_p}%} to 0
				set {lvl::%{_p}%} to 2
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 2
			{_x}>1:
				set {exp::%{_p}%} to ({_x}-1)*100+{_y}
				set {lvl::%{_p}%} to 2
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 2
		{lvl::%{_p}%} is 2:
			set {_x} to ceiling({exp::%{_p}%}/200)
			set {_y} to mod({exp::%{_p}%},200)
			{_x}==1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/200
					stop
				set {exp::%{_p}%} to 0
				set {lvl::%{_p}%} to 3
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 3
			{_x}>1:
				set {exp::%{_p}%} to ({_x}-1)*200+{_y}
				set {lvl::%{_p}%} to 3
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 3
		{lvl::%{_p}%} is 3:
			set {_x} to ceiling({exp::%{_p}%}/300)
			set {_y} to mod({exp::%{_p}%},300)
			{_x}==1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/300
					stop
				set {exp::%{_p}%} to 0
				set {lvl::%{_p}%} to 4
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 4
			{_x}>1:
				set {exp::%{_p}%} to ({_x}-1)*300+{_y}
				set {lvl::%{_p}%} to 4
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 4
		{lvl::%{_p}%} is 4:
			set {_x} to ceiling({exp::%{_p}%}/400)
			set {_y} to mod({exp::%{_p}%},400)
			{_x}==1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/400
					stop
				set {exp::%{_p}%} to 0
				set {lvl::%{_p}%} to 5
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 5
			{_x}>1:
				set {exp::%{_p}%} to ({_x}-1)*400+{_y}
				set {lvl::%{_p}%} to 5
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 5
		{lvl::%{_p}%} is 5:
			set {_x} to ceiling({exp::%{_p}%}/500)
			set {_y} to mod({exp::%{_p}%},500)
			{_x}==1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/500
					stop
				set {exp::%{_p}%} to 0
				set {lvl::%{_p}%} to 6
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 6
			{_x}>1:
				set {exp::%{_p}%} to ({_x}-1)*500+{_y}
				set {lvl::%{_p}%} to 6
				send "&r&aAwansowales!" to {_p}
				set {_p}'s level progress to {exp::%{_p}%}
				set {_p}'s level to 6

Skrypt 2:

on damage:
  set {_EPF} to 0
  loop 20 times:
    lore of victim's helmet is "&3Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's leggings is "&3Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's chestplate is "&3Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's boots is "&3Obrona %loop-number%":
      add loop-number to {_EPF}
  loop 4 times:
    set {_Q::%loop-number%} to {_EPF}/25
    set {_Q::%loop-number%} to {_Q::%loop-number%}/loop-number
    set {_Q::%loop-number%} to 1-{_Q::%loop-number%}
    set {_eEPF} to 20*loop-number
    {_EPF} < {_eEPF}:
      set damage to damage * {_Q::%loop-number%}
      stop

 

Odnośnik do komentarza
Udostępnij na innych stronach

17 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Uprościłem kod (wcześniej na to nie wpadłem xD)

command /exp <offlineplayer=%player%> <number=10>:
	permission: exp.add
	trigger:
		set {_p} to offlineplayer-arg
		add number-arg to {exp::%{_p}%}
		{lvl::%player%} is 1:
			set {_x} to ceiling({exp::%{_p}%}/100)
			set {_y} to mod({exp::%{_p}%},100)
			{_y} != 0:
				set {_p}'s level progress to {exp::%{_p}%}/100
				stop
			subtract 100 from {exp::%player%}
			set {lvl::%{_p}%} to 2
			send "&r&aAwansowales!" to {_p}
		{lvl::%{_p}%} is 2:
			set {_x} to ceiling({exp::%{_p}%}/200)
			set {_y} to mod({exp::%{_p}%},200)
			{_y} != 0:
				set {_p}'s level progress to {exp::%{_p}%}/200
				stop
			subtract 200 from {exp::%player%}
			set {lvl::%{_p}%} to 3
			send "&r&aAwansowales!" to {_p}
		{lvl::%{_p}%} is 3:
			set {_x} to ceiling({exp::%{_p}%}/300)
			set {_y} to mod({exp::%{_p}%},300)
			{_y} != 0:
				set {_p}'s level progress to {exp::%{_p}%}/300
				stop
			set {lvl::%{_p}%} to 4
			send "&r&aAwansowales!" to {_p}
			subtract 300 from {exp::%player%}
		{lvl::%{_p}%} is 4:
			set {_x} to ceiling({exp::%{_p}%}/400)
			set {_y} to mod({exp::%{_p}%},400)
			{_y} != 0:
				set {_p}'s level progress to {exp::%{_p}%}/400
				stop
			set {lvl::%{_p}%} to 5
			send "&r&aAwansowales!" to {_p}
			subtract 400 from {exp::%player%}
		{lvl::%{_p}%} is 5:
			set {_x} to ceiling({exp::%{_p}%}/500)
			set {_y} to mod({exp::%{_p}%},500)
			{_y} != 0:
				set {_p}'s level progress to {exp::%{_p}%}/500
				stop
			set {lvl::%{_p}%} to 6
			send "&r&aAwansowales!" to {_p}
			subtract 500 from {exp::%player%}
		set {_p}'s lvl to {lvl::%{_p}%}
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Hhhhhh

Nie ma sprawdzania poziomu xD

command /exp <offlineplayer=%player%> <number=10>:
	permission: exp.add
	trigger:
		set {_p} to offlineplayer-arg
		add number-arg to {exp::%{_p}%}
		{lvl::%player%} is 1:
			set {_x} to floor({exp::%{_p}%}/100)
			set {_y} to mod({exp::%{_p}%},100)
  			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/100
					stop
			subtract 100 from {exp::%player%}
			set {lvl::%{_p}%} to 2
			send "&r&aAwansowales!" to {_p}
		{lvl::%{_p}%} is 2:
			set {_x} to ceiling({exp::%{_p}%}/200)
			set {_y} to mod({exp::%{_p}%},200)
  			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/200
					stop
			subtract 200 from {exp::%player%}
			set {lvl::%{_p}%} to 3
			send "&r&aAwansowales!" to {_p}
		{lvl::%{_p}%} is 3:
			set {_x} to ceiling({exp::%{_p}%}/300)
			set {_y} to mod({exp::%{_p}%},300)
  			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/300
					stop
			set {lvl::%{_p}%} to 4
			send "&r&aAwansowales!" to {_p}
			subtract 300 from {exp::%player%}
		{lvl::%{_p}%} is 4:
			set {_x} to ceiling({exp::%{_p}%}/400)
			set {_y} to mod({exp::%{_p}%},400)
  			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/400
					stop
			set {lvl::%{_p}%} to 5
			send "&r&aAwansowales!" to {_p}
			subtract 400 from {exp::%player%}
		{lvl::%{_p}%} is 5:
			set {_x} to ceiling({exp::%{_p}%}/500)
			set {_y} to mod({exp::%{_p}%},500)
  			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/500
					stop
			set {lvl::%{_p}%} to 6
			send "&r&aAwansowales!" to {_p}
			subtract 500 from {exp::%player%}
		set {_p}'s lvl to {lvl::%{_p}%}

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Wszystko jest ok. Wejdź w notepad++/Sublime tekst, wciśnij CTRL+F i wejdź w replace. Zamień wszystkie cztery spacje na Taby i powinno działać (u mnie nie ma żadnych błędów z wytabowaniem), ew. skopiuj jeszcze raz i wklej

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Jest jakiś sposób żeby skopiować te błędy a nie je przepisywać ?

 

[11:27:01 ERROR]: [Skript] indentation error: expected 3 tabs, but found '__->->->' [-> = tab, _ = space, ? = other whitespace] (wiadomosc.sk, line 108: {_x} < 1:')
[11:27:01 ERROR]: [Skript] indentation error: expected 3 tabs, but found 4 tabs (wiadomosc.sk, line 109: {_y} != 0:')
[11:27:01 ERROR]: [Skript] indentation error: expected 3 tabs, but found 5 tabs (wiadomosc.sk, line 110: set {_p}'s level progress to {exp::%{_p}%}/500')
[11:27:01 ERROR]: [Skript] indentation error: expected 3 tabs, but found 5 tabs (wiadomosc.sk, line 111: stop')

 

//Nie spamuj; łączę wszystko ~PoweredDragon

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
command /exp <offlineplayer=%player%> <number=10>:
	permission: exp.add
	trigger:
		set {_p} to offlineplayer-arg
		add number-arg to {exp::%{_p}%}
		{lvl::%player%} is 1:
			set {_x} to floor({exp::%{_p}%}/100)
			set {_y} to mod({exp::%{_p}%},100)
			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/100
					stop
			subtract 100 from {exp::%player%}
			set {lvl::%{_p}%} to 2
			send "&r&aAwansowales!" to {_p}
		{lvl::%{_p}%} is 2:
			set {_x} to ceiling({exp::%{_p}%}/200)
			set {_y} to mod({exp::%{_p}%},200)
			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/200
					stop
			subtract 200 from {exp::%player%}
			set {lvl::%{_p}%} to 3
			send "&r&aAwansowales!" to {_p}
		{lvl::%{_p}%} is 3:
			set {_x} to ceiling({exp::%{_p}%}/300)
			set {_y} to mod({exp::%{_p}%},300)
			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/300
					stop
			set {lvl::%{_p}%} to 4
			send "&r&aAwansowales!" to {_p}
			subtract 300 from {exp::%player%}
		{lvl::%{_p}%} is 4:
			set {_x} to ceiling({exp::%{_p}%}/400)
			set {_y} to mod({exp::%{_p}%},400)
			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/400
					stop
			set {lvl::%{_p}%} to 5
			send "&r&aAwansowales!" to {_p}
			subtract 400 from {exp::%player%}
		{lvl::%{_p}%} is 5:
			set {_x} to ceiling({exp::%{_p}%}/500)
			set {_y} to mod({exp::%{_p}%},500)
			{_x} < 1:
				{_y} != 0:
					set {_p}'s level progress to {exp::%{_p}%}/500
					stop
			set {lvl::%{_p}%} to 6
			send "&r&aAwansowales!" to {_p}
			subtract 500 from {exp::%player%}
		set {_p}'s lvl to {lvl::%{_p}%}

wszystko już działa :v

Odnośnik do komentarza
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ę...