Skocz do zawartości
  • 0

Woda zadaje damage


WiecznyRD

Pytanie

Siemka, potrzebuje skryptu żeby woda zadawała na przykład 2 serduszka oraz żeby była możliwość że jak się wypije potkę to dawała odporność na przykład na 10 min, najlepiej też żeby było można zmieniać nazwę oraz recepturę potki.

 

Odnośnik do komentarza
https://skript.pl/temat/50225-woda-zadaje-damage/
Udostępnij na innych stronach

13 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
on script load:
    register new shaped recipe for water bottle named "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond

on join:
    set {damage::%event-player%} to true

every 1 second:
    loop all players:
        while block at loop-player is water:
            if {damage::%loop-player%} is true:
                damage loop-player by 2 hearts
            else:
                if {damage::%loop-player%} is false:
                    stop

on consume:
    if player's tool is water bottle named "&5Potka no-damage":
        add 600 to {czas::%player%}
            while player is online:
                if {czas::%player%} > 0:
                    wait 1 second
                    remove 1 from {czas::%player%}
                else:
                    if {czas::%player%} <= 0:
                        send "&aCzas działania potki skończy się za 10 sekund!" to player
                        wait 10 seconds
                        set {damage::%player%} to true

 

W evencie on script load masz recepturę i nazwę napoju. Jeśli ją zmieniasz, to musisz pamiętać o tym, że musisz zmienić ją również w evencie on consume.

Mam nadzieję, że będzie działać, ale mam okropne problemy z internetem i nie mam dostępu do dokumentacji skript, więc napisałem, jak umiałem...

Jak są jakieś błędy, to je wyślij

Notro

Wstawiam w code

Notatka dodana przez Notro

Odnośnik do komentarza
https://skript.pl/temat/50225-woda-zadaje-damage/#findComment-311184
Udostępnij na innych stronach

  • 0
16 minut temu, hbrt napisał:

on script load:
    register new shaped recipe for water bottle named "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond

on join:
    set {damage::%event-player%} to true

every 1 second:
    loop all players:
        while block at loop-player is water:
            if {damage::%loop-player%} is true:
                damage loop-player by 2 hearts
            else:
                if {damage::%loop-player%} is false:
                    stop

on consume:
    if player's tool is water bottle named "&5Potka no-damage":
        add 600 to {czas::%player%}
            while player is online:
                if {czas::%player%} > 0:
                    wait 1 second
                    remove 1 from {czas::%player%}
                else:
                    if {czas::%player%} <= 0:
                        send "&aCzas działania potki skończy się za 10 sekund!" to player
                        wait 10 seconds
                        set {damage::%player%} to true

 

Napisałem w takiej formie, bo nie mogę kliknąć w zakładkę kod, bo wyskakuje mi błąd.

W evencie on script load masz recepturę i nazwę napoju. Jeśli ją zmieniasz, to musisz pamiętać o tym, że musisz zmienić ją również w evencie on consume.

Mam nadzieję, że będzie działać, ale mam okropne problemy z internetem i nie mam dostępu do dokumentacji skript, więc napisałem, jak umiałem...

Jak są jakieś błędy, to je wyślij

 

Błędy:

Spoiler
[21:23:21 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. (wat.sk, line 1: on script load:')
[21:23:21 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. (wat.sk, line 4: on join:')
[21:23:21 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. (wat.sk, line 7: every 1 second:')
[21:23:21 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. (wat.sk, line 8:     loop all players:')
[21:23:21 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. (wat.sk, line 9:         while block at loop-player is water:')
[21:23:21 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. (wat.sk, line 10:             if {damage::%loop-player%} is true:')
[21:23:21 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. (wat.sk, line 12:             else:')
[21:23:21 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. (wat.sk, line 13:                 if {damage::%loop-player%} is false:')
[21:23:21 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. (wat.sk, line 16: on consume:')
[21:23:21 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. (wat.sk, line 17:     if player's tool is water bottle named "&5Potka no-damage":')
[21:23:21 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. (wat.sk, line 19:             while player is online:')
[21:23:21 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. (wat.sk, line 20:                 if {czas::%player%} > 0:')
[21:23:21 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. (wat.sk, line 23:                 else:')
[21:23:21 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. (wat.sk, line 24:                     if {czas::%player%} <= 0:')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 2:     register new shaped recipe for water bottle named "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 5:     set {damage::%event-player%} to true')
[21:23:21 ERROR]: can't understand this event: '    loop all players' (wat.sk, line 8:     loop all players:')
[21:23:21 ERROR]: can't understand this event: '        while block at loop-player is water' (wat.sk, line 9:         while block at loop-player is water:')
[21:23:21 ERROR]: can't understand this event: '            if {damage::%loop-player%} is true' (wat.sk, line 10:             if {damage::%loop-player%} is true:')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 11:                 damage loop-player by 2 hearts')
[21:23:21 ERROR]: can't understand this event: '            else' (wat.sk, line 12:             else:')
[21:23:21 ERROR]: can't understand this event: '                if {damage::%loop-player%} is false' (wat.sk, line 13:                 if {damage::%loop-player%} is false:')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 14:                     stop')
[21:23:21 ERROR]: can't understand this event: '    if player's tool is water bottle named "&5Potka no-damage"' (wat.sk, line 17:     if player's tool is water bottle named "&5Potka no-damage":')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 18:         add 600 to {czas::%player%}')
[21:23:21 ERROR]: can't understand this event: '            while player is online' (wat.sk, line 19:             while player is online:')
[21:23:21 ERROR]: can't understand this event: '                if {czas::%player%} > 0' (wat.sk, line 20:                 if {czas::%player%} > 0:')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 21:                     wait 1 second')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 22:                     remove 1 from {czas::%player%}')
[21:23:21 ERROR]: can't understand this event: '                else' (wat.sk, line 23:                 else:')
[21:23:21 ERROR]: can't understand this event: '                    if {czas::%player%} <= 0' (wat.sk, line 24:                     if {czas::%player%} <= 0:')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 25:                         send "&aCzas działania potki skończy się za 10 sekund!" to player')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 26:                         wait 10 seconds')
[21:23:21 ERROR]: invalid line - all code has to be put into triggers (wat.sk, line 27:                         set {damage::%player%} to true')

 

Notro

Wstawiam błędy w code

Notatka dodana przez Notro

Odnośnik do komentarza
https://skript.pl/temat/50225-woda-zadaje-damage/#findComment-311185
Udostępnij na innych stronach

  • 0
on script load:
	register new shaped recipe for water bottle named "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond

variables:
	set {damage::*} to true

every 1 second:
	loop all players:
		if block at loop-player is water:
			if {damage::%loop-player%} is true:
				damage loop-player by 2 hearts
			else:
				if {damage::%loop-player%} is false:
					stop

on consume:
	if player's tool is water bottle named "&5Potka no-damage":
		add 600 to {czas::%player%}
			while player is online:
				if {czas::%player%} > 0:
					wait 1 second
					remove 1 from {czas::%player%}
				else:
					if {czas::%player%} <= 0:
						send "&aCzas działania potki skończy się za 10 sekund!" to player
						wait 10 seconds
						set {damage::%player%} to true

jeśli nie działa to napisz jaką masz wersję skript

Odnośnik do komentarza
https://skript.pl/temat/50225-woda-zadaje-damage/#findComment-311186
Udostępnij na innych stronach

  • 0
2 minuty temu, hbrt napisał:
on script load:
	register new shaped recipe for water bottle named "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond

variables:
	set {damage::*} to true

every 1 second:
	loop all players:
		if block at loop-player is water:
			if {damage::%loop-player%} is true:
				damage loop-player by 2 hearts
			else:
				if {damage::%loop-player%} is false:
					stop

on consume:
	if player's tool is water bottle named "&5Potka no-damage":
		add 600 to {czas::%player%}
			while player is online:
				if {czas::%player%} > 0:
					wait 1 second
					remove 1 from {czas::%player%}
				else:
					if {czas::%player%} <= 0:
						send "&aCzas działania potki skończy się za 10 sekund!" to player
						wait 10 seconds
						set {damage::%player%} to true

jeśli nie działa to napisz jaką masz wersję skript

[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 3 tabs (wat.sk, line 19: while player is online:')
[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 4 tabs (wat.sk, line 20: if {czas::%player%} > 0:')
[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 5 tabs (wat.sk, line 21: wait 1 second')
[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 5 tabs (wat.sk, line 22: remove 1 from {czas::%player%}')
[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 4 tabs (wat.sk, line 23: else:')
[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 5 tabs (wat.sk, line 24: if {czas::%player%} <= 0:')
[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 6 tabs (wat.sk, line 25: send "&aCzas działania potki skończy się za 10 sekund!" to player')
[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 6 tabs (wat.sk, line 26: wait 10 seconds')
[21:59:25 ERROR]: indentation error: expected 2 tabs, but found 6 tabs (wat.sk, line 27: set {damage::%player%} to true')
[21:59:25 ERROR]: Can't understand this condition/effect: register new shaped recipe for water bottle named "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond (wat.sk, line 2: register new shaped recipe for water bottle named "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond')
[21:59:25 ERROR]: 'set {damage::*} to true' is not an entry (like 'name = value') (wat.sk, line 5: set {damage::*} to true')
[22:00:57 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[22:00:57 INFO]: [Skript] Skript's documentation can be found here: https://skriptlang.github.io/Skript
[22:00:57 INFO]: [Skript] Server Version: git-Purpur-1370 (MC: 1.17.1)
[22:00:57 INFO]: [Skript] Skript Version: 2.6-beta3
[22:00:57 INFO]: [Skript] Installed Skript Addons:

 

Odnośnik do komentarza
https://skript.pl/temat/50225-woda-zadaje-damage/#findComment-311187
Udostępnij na innych stronach

  • 0
on script load:
	register new shapeless recipe for water bottle from "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond

variables:
	set {damage::*} to true

every 1 second:
	loop all players:
		if block at loop-player is water:
			if {damage::%loop-player%} is true:
				damage loop-player by 2 hearts
			else:
				if {damage::%loop-player%} is false:
					stop

on consume:
	if player's tool is water bottle named "&5Potka no-damage":
		add 600 to {czas::%player%}
			while player is online:
				if {czas::%player%} > 0:
					wait 1 second
					remove 1 from {czas::%player%}
				else:
					if {czas::%player%} <= 0:
						send "&aCzas działania potki skończy się za 10 sekund!" to player
						wait 10 seconds
						set {damage::%player%} to true

może teraz?

Odnośnik do komentarza
https://skript.pl/temat/50225-woda-zadaje-damage/#findComment-311224
Udostępnij na innych stronach

  • 0
37 minut temu, hbrt napisał:
on script load:
	register new shapeless recipe for water bottle from "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond

variables:
	set {damage::*} to true

every 1 second:
	loop all players:
		if block at loop-player is water:
			if {damage::%loop-player%} is true:
				damage loop-player by 2 hearts
			else:
				if {damage::%loop-player%} is false:
					stop

on consume:
	if player's tool is water bottle named "&5Potka no-damage":
		add 600 to {czas::%player%}
			while player is online:
				if {czas::%player%} > 0:
					wait 1 second
					remove 1 from {czas::%player%}
				else:
					if {czas::%player%} <= 0:
						send "&aCzas działania potki skończy się za 10 sekund!" to player
						wait 10 seconds
						set {damage::%player%} to true

może teraz?

 

[16:21:01 ERROR]: 'set {damage::*} to true' is not an entry (like 'name = value') (dw.sk, line 2: set {damage::*} to true')

wyskakuje jeszcze taki błąd, potka nie działa a wiadomość że czas potki się kończy pojawia się co 10 sekund po odliczeniu całego czasu

 

Edytowane przez WiecznyRD
Odnośnik do komentarza
https://skript.pl/temat/50225-woda-zadaje-damage/#findComment-311226
Udostępnij na innych stronach

  • 0
on script load:
	register new shapeless recipe for water bottle from "&5Potkano-damage" using diamond, gold, diamond, gold, water bottle, gold, diamond, gold, diamond

every 1 second:
	loop all players:
		loop 100 times:
			if block at loop-player is water:
				if {damage::%loop-player%} is 0:
					wait 1 second
					damage loop-player by 2 hearts
				else:
					if {damage::%loop-player%} is 1:
						stop

on consume:
	if player's tool is water bottle named "&5Potka no-damage":
		add 600 to {czas::%player%}
		set {damage::%player%} to 1
			while player is online:
				if {czas::%player%} > 0:
					wait 1 second
					remove 1 from {czas::%player%}
				else:
					if {czas::%player%} <= 0:
						send "&aCzas działania potki skończy się za 10 sekund!" to player
						wait 10 seconds
						set {damage::%player%} to 0

a teraz? XD

Odnośnik do komentarza
https://skript.pl/temat/50225-woda-zadaje-damage/#findComment-311227
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ę...