Skocz do zawartości
  • 0

cooldown przycisku


Krzysiek554
 Udostępnij

Pytanie

Witam, proszę o dopisanie cooldown 5 sekund do tego kodu. Tak aby co 5 sekund można było poprawnie użyć świniarki.

on right click on stone button:
    block behind target block is 98:3:
        if {allow.mieso} is true:
            if {DragoPIG.spawn.1} is set:
                spawn 1 pig at {DragoPIG.spawn.1}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.1}
                ignite last spawned pig
            if {DragoPIG.spawn.2} is set:
                spawn 1 pig at {DragoPIG.spawn.2}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.2}
                ignite last spawned pig
            if {DragoPIG.spawn.3} is set:
                spawn 1 pig at {DragoPIG.spawn.3}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.3}
                ignite last spawned pig
            if {DragoPIG.spawn.4} is set:
                spawn 1 pig at {DragoPIG.spawn.4}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.4}
                ignite last spawned pig
            if {DragoPIG.spawn.5} is set:
                spawn 1 pig at {DragoPIG.spawn.5}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.5}
                ignite last spawned pig
            if {DragoPIG.spawn.6} is set:
                spawn 1 pig at {DragoPIG.spawn.6}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.6}
                ignite last spawned pig

 

Odnośnik do komentarza
Udostępnij na innych stronach

16 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Nie Testowałem Jak Są Błędy Pisz

 

on right click on stone button:
    block behind target block is 98:3:
        if {allow.mieso} is true:
            set {_czas} to difference between {spam.%player%} and now
            if {DragoPIG.spawn.1} is set:
                spawn 1 pig at {DragoPIG.spawn.1}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.1}
                ignite last spawned pig
            if {DragoPIG.spawn.2} is set:
                spawn 1 pig at {DragoPIG.spawn.2}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.2}
                ignite last spawned pig
            if {DragoPIG.spawn.3} is set:
                spawn 1 pig at {DragoPIG.spawn.3}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.3}
                ignite last spawned pig
            if {DragoPIG.spawn.4} is set:
                spawn 1 pig at {DragoPIG.spawn.4}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.4}
                ignite last spawned pig
            if {DragoPIG.spawn.5} is set:
                spawn 1 pig at {DragoPIG.spawn.5}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.5}
                ignite last spawned pig
            if {DragoPIG.spawn.6} is set:
                spawn 1 pig at {DragoPIG.spawn.6}
                ignite last spawned pig
                spawn 1 pig at {DragoPIG.spawn.6}
                ignite last spawned pig        
            if {_czas} is less than 5 seconds:
                send "&cCo 5 Sekund Mozna Uzyc Tego Guziczka"
                cancel event
                stop
            else:
                set {spam.%player%} to now

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

A Ten Skrypt

on right click on stone button:
    block behind target block is 98:3:
        if {allow.mieso} is true:
            if player doesn't have permissions "miesko":
                set {_czas} to difference between {spam.%player%} and now
                if {_czas} is less than 5 seconds:
                send "&cNa chacie mozna pisac co 5 sekund!"
                cancel event
                stop
            else:
                set {spam.%player%} to now
                if {allow.mieso} is true:
                    if {DragoPIG.spawn.1} is set:
                        spawn 1 pig at {DragoPIG.spawn.1}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.1}
                        ignite last spawned pig
                    if {DragoPIG.spawn.2} is set:
                        spawn 1 pig at {DragoPIG.spawn.2}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.2}
                        ignite last spawned pig
                if {DragoPIG.spawn.3} is set:
                        spawn 1 pig at {DragoPIG.spawn.3}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.3}
                        ignite last spawned pig
                if {DragoPIG.spawn.4} is set:
                        spawn 1 pig at {DragoPIG.spawn.4}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.4}
                        ignite last spawned pig
                if {DragoPIG.spawn.5} is set:
                        spawn 1 pig at {DragoPIG.spawn.5}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.5}
                        ignite last spawned pig
                if {DragoPIG.spawn.6} is set:
                        spawn 1 pig at {DragoPIG.spawn.6}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.6}
                        ignite last spawned pig

Pamiętaj o tym aby dodać permisje do gracza "miesko" i zdjąć sobie permisje podczas testowania  op ma all permisje przypominam

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

  • 0

on right click on stone button:
    block behind target block is 98:3:
        if {allow.mieso} is true:
                set {_czas} to difference between {spam.%player%} and now
                if {_czas} is less than 5 seconds:
                send "&cNa chacie mozna pisac co 5 sekund!"
                cancel event
                stop
            else:
                set {spam.%player%} to now
                if {allow.mieso} is true:
                    if {DragoPIG.spawn.1} is set:
                        spawn 1 pig at {DragoPIG.spawn.1}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.1}
                        ignite last spawned pig
                    if {DragoPIG.spawn.2} is set:
                        spawn 1 pig at {DragoPIG.spawn.2}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.2}
                        ignite last spawned pig
                if {DragoPIG.spawn.3} is set:
                        spawn 1 pig at {DragoPIG.spawn.3}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.3}
                        ignite last spawned pig
                if {DragoPIG.spawn.4} is set:
                        spawn 1 pig at {DragoPIG.spawn.4}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.4}
                        ignite last spawned pig
                if {DragoPIG.spawn.5} is set:
                        spawn 1 pig at {DragoPIG.spawn.5}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.5}
                        ignite last spawned pig
                if {DragoPIG.spawn.6} is set:
                        spawn 1 pig at {DragoPIG.spawn.6}
                        ignite last spawned pig
                        spawn 1 pig at {DragoPIG.spawn.6}
                        ignite last spawned pig

Tu masz bez permisji jak  masz errory to podaj

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

  • 0
on right click on stone button:
    block behind target block is 98:3:
        if {allow.mieso} is true:
			if {czas::%player%} > 0:
				send "Odczekaj jeszcze %{czas::%player%}% s"
			else:
				if {DragoPIG.spawn.1} is set:
					spawn 1 pig at {DragoPIG.spawn.1}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.1}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.2} is set:
					spawn 1 pig at {DragoPIG.spawn.2}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.2}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.3} is set:
					spawn 1 pig at {DragoPIG.spawn.3}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.3}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.4} is set:
					spawn 1 pig at {DragoPIG.spawn.4}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.4}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.5} is set:
					spawn 1 pig at {DragoPIG.spawn.5}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.5}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.6} is set:
					spawn 1 pig at {DragoPIG.spawn.6}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.6}
					ignite last spawned pig
					set {czas::%player%} to "5"
every 1 second:
	{czas::%player%} > 0:
		remove 1 from {czas::%player%}

@down #What? Dałem ci gotowy działający kod, a ty czekasz na dalsze odpowiedzi... Nic nie wyjaśniłeś jak to ma być więc napisałem tak jak jest...

 

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

  • 0
19 godzin temu, Switsherker napisał:
on right click on stone button:
    block behind target block is 98:3:
        if {allow.mieso} is true:
			if {czas::%player%} > 0:
				send "Odczekaj jeszcze %{czas::%player%}% s"
			else:
				if {DragoPIG.spawn.1} is set:
					spawn 1 pig at {DragoPIG.spawn.1}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.1}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.2} is set:
					spawn 1 pig at {DragoPIG.spawn.2}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.2}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.3} is set:
					spawn 1 pig at {DragoPIG.spawn.3}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.3}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.4} is set:
					spawn 1 pig at {DragoPIG.spawn.4}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.4}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.5} is set:
					spawn 1 pig at {DragoPIG.spawn.5}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.5}
					ignite last spawned pig
					set {czas::%player%} to "5"
				if {DragoPIG.spawn.6} is set:
					spawn 1 pig at {DragoPIG.spawn.6}
					ignite last spawned pig
					spawn 1 pig at {DragoPIG.spawn.6}
					ignite last spawned pig
					set {czas::%player%} to "5"
every 1 second:
	{czas::%player%} > 0:
		remove 1 from {czas::%player%}

@down #What? Dałem ci gotowy działający kod, a ty czekasz na dalsze odpowiedzi... Nic nie wyjaśniłeś jak to ma być więc napisałem tak jak jest...

 

poprawisz taby?

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
every 1 second:
	loop all players:
		if {czas::%loop-player%} is bigger than "0":
			remove 1 from {czas::%loop-player%}
#lub
every 1 second:
	if {czas::%player%} is bigger than "0":
		remove 1 from {czas::%player%}

#Na początku kodu daj jeszcze:
variables:
	{czas::%player%} = 0 #Jeśli ci nie wczyta to usuń :>

@edit Szczerze to nwm, czy dobrze napisałem "is bigger than "0"", bo zbytnio tego nie używam...

Edytowane przez Switsherker
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ę...