Skocz do zawartości
  • 0

Problem z if i else


elcuadrado

Pytanie

Cześć! Szukałem bardzo dużo na forach skrypty na życia, które znalazłem. Trzeba było użyć 1 diament by dodało ci 1 życie ale znowu szukałem po czym skopiowałem i wkleiłem jeden fragment, skrypt zaczął działać ale jedna linijka już nie. Skrypt powinien blokować używanie potionu do maksymalnej liczby 10 żyć ale ten limit nie działa, działał w przypadku diaxa. Pomóżcie mi!
Kiedy używam komendy: /skript reload zycia
pisze mi to:
Empty configuration section! You might want to indent one or more of the subsequent lines to make them belond to this section or remove the colon at the end of the line id you don't want this line to start a section. (zycia.sk, line 32: if {zycia.%player%) is 10:')
Can't understand this condition/effect: else (zycia.sk, line 33: else')

Skrypt: (event on drink)

options:
    tag : &7[&cZycia&7]
variables:
    {zycia.%player%} = 3
aliases:
    diax = minecraft:diamond
on death of player:
    remove 1 from {zycia.%player%}
    send "{@tag} &7Umarles i straciles &c1 &7zycie." to player
    send "{@tag} &7Twoje zycia wynosza teraz&c %{zycia.%player%}%" to player
command /zycia:
    trigger:
        send "&b{@tag} &7Twoje zycia : &c%{zycia.%player%}%"
command /dodajzycia <text>:
    permission: zycia.dodaj
    trigger:
        add 3 to {zycia.%argument%}
        send "dodane"
        execute console command "unban %argument%"
command /ulecz <text>:
    trigger:
        if {zycia.%argument%} is 0:
            remove 1 from {zycia.%player%}
            add 1 to {zycia.%argument%}
            send "{@tag} &7Oddales 1 zycie graczowi &c%argument%"
            execute console command "unban %argument%"
        else:
            send "{@tag} &7Ten gracz zyje , nie ma potrzeby oddawac mu zycia"
on drink:
    if event-item's name is "&cMikstura Zycia":
        if {zycia.%player%} is 10:
        send "{@tag} &7Limit zyc wynosi &c10"
        else:
        add 1 to {zycia.%player%}
        send "{@tag} &7Dostales 1 zycie , twoje zycia wynosza teraz %{zycia.%player%}%"
every 3 real seconds:
    loop all players:
        {zycia.%loop-player%} is 0:
            broadcast "{@tag} &f%loop-player% ma 0 zyc i zostal zbanowany"
            execute console command "tempban %loop-player% 24h &c&lStraciles wszystkie zycia :("

 

Edytowane przez xAxee
xAxee

Wstawiam w code

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/38207-problem-z-if-i-else/
Udostępnij na innych stronach

3 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
on drink:
	if event-item's name is "&cMikstura Zycia":
		if {zycia.%player%} is 10:
			send "{@tag} &7Limit zyc wynosi &c10"
		else:
			add 1 to {zycia.%player%}
			send "{@tag} &7Dostales 1 zycie , twoje zycia wynosza teraz %{zycia.%player%}%"

 

Odnośnik do komentarza
https://skript.pl/temat/38207-problem-z-if-i-else/#findComment-241632
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ę...