Skocz do zawartości
  • 0

Cooldown.


Kubo0208
 Udostępnij

Pytanie

Prosze o pomoc ze skryptem jak cos jestem nowy:
Problem jest w tym że delay miał być 60 sekund i nie umiem tego ustawić, błędu niby nie ma, ale chce zeby co 60 sekund mozna by bylo strzelić fire ballem.  i to jest zepsute że cały czas moge strzelać

options:
    delay: 0
command /ftgive [<text>]:
    permission: admin.testujemy
    permission message: pojebANy jestes...
    trigger:
        if player is in world "hollow":
            give player blaze rod named "FireBall Thrower"
            send "&8&l> &cOtrzymales 1x FireBall Thrower."
        else:
            send "&cMusisz byc na arenie."
on rightclick holding a blaze rod:
    if name of player's tool is "FireBall Thrower":
        if {delay} is 60:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo okolo 60 sekund."
        else:
        if {delay} is 45:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo okolo 45 sekund."
        else:
        if {delay} is 30:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo okolo 30 sekund."
        else:
        if {delay} is 15:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo okolo 15 sekund."
        else:
        if {delay} is 5:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo 5 sekund."
        else:
        if {delay} is 4:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo 4 sekund."
        else:
        if {delay} is 3:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo 3 sekund."
        else:
        if {delay} is 2:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo 2 sekund."
        else:
        if {delay} is 1:
            send "&cMusisz poczekac troche, aby ponownie tego uzyc!"
            set action bar of player to "&cFireBall Thrower pozostalo 1 sekund."
        else:
            if {delay} is 0:
                shoot a fireball from player
                set {delay} to 60
                wait 60 real seconds
                set {delay} to 0
on drop:
    event-item is a blaze rod:
        cancel event

prosze o pomoc.

Edytowane przez Michix
Glicz

Wstawiam kod w code.

Notatka dodana przez Glicz

Odnośnik do komentarza
Udostępnij na innych stronach

5 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
11 minut temu, Kubo0208 napisał:

Prosze o pomoc ze skryptem jak cos jestem nowy:
Problem jest w tym że delay miał być 60 sekund i nie umiem tego ustawić, błędu niby nie ma, ale chce zeby co 60 sekund mozna by bylo strzelić fire ballem.  i to jest zepsute że cały czas moge strzelać

Zarejestruj się lub zaloguj, aby zobaczyć ukrytą treść! masz przykładowo pokazane jak można zaimplementować cooldown.

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
15 minut temu, Kubo0208 napisał:

Mógłbyś mi to przerobić?, byłbym bardzo wdźięczny, ja zbyt tego nie ogarniam tylko podstawowe umiem pisać.

W takim wypadku uznaję to za zlecenie.

options:
	delay: 60 seconds
	
function translateTimespan(t: timespan) :: text:
	set {_t} to "%{_t}%"
	set {_eng::*} to "years", "year", "months", "month", "days", "day", "hours", "hour", "minutes", "minute", "seconds", "second" and " and "
	set {_pol::*} to "lat", "rok", "miesięcy", "miesiąc", "dni", "dzień", "godzin", "godzinę", "minut", "minutę", "sekund", "sekundę" and ", "
	loop {_eng::*}:
		replace all loop-value with {_pol::%loop-index%} in {_t}
	return {_t}	
	
command /ftgive [<text>]:
	permission: admin.testujemy
	permission message: po[ciach]any jestes...
	trigger:
		if player is in world "hollow":
			give player blaze rod named "FireBall Thrower"
			send "&8&l> &cOtrzymales 1x FireBall Thrower."
		else:
			send "&cMusisz byc na arenie."
			
on rightclick holding a blaze rod:
	name of player's tool is "FireBall Thrower"
	{cooldownFireballThrower::%player%} is set:
		difference between {cooldownFireballThrower::%player%} and now is less than {@delay}
		set {_t} to {cooldownFireballThrower::%player%}
		add {@delay} to {_t}
		send "&cMożesz ponownie wystrzelić kulę ognia za &6%translateTimespan(difference between {_t} and now)%" to player
		stop
	set {cooldownFireballThrower::%player%} to now
	shoot a fireball from player

 

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