Skocz do zawartości
  • 0

[przerubka skrypty] na lobby


fabi19876

Pytanie

9 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
function cooldown(p: player):: boolean:
	set {%{_p}%::move} to false
    loop 5 times:
    	wait 1 second
        if {%{_p}%::move}:
        	set {%{_p}%::move} to false
        	return false
	return true
command /lobby [<text>]:
	trigger:
    	if cooldown(player):
        	send "Poruszyłeś się!"
            stop
		teleport player to location at -187, 64, 5 in world "world"        
		send "&a&lZostałeś teleportowany do lobby"
on any move:
	set {%player%::move} to true

ale wytabować trzeba, coś mi zepsuł format

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
command /lobby [<text>]:
	trigger:
		set {_l} to location of player
		set {_s} to 5
		while {_s} > 0:
			if distance between {_l} and location of player > 0.1:
				send "Poruszyles sie!"
				stop
			remove 1 from {_s}
			wait second
		teleport player to location at -187, 64, 5 in world "world"        
		send "&a&lZostałeś teleportowany do lobby"

Powinno byc ok

Spoiler


Teraz, GRIERIOR napisał:
function cooldown(p: player):: boolean:
	set {%{_p}%::move} to false
    loop 5 times:
    	wait 1 second
        if {%{_p}%::move}:
        	set {%{_p}%::move} to false
        	return false
	return true
command /lobby [<text>]:
	trigger:
    	if cooldown(player):
        	send "Poruszyłeś się!"
            stop
		teleport player to location at -187, 64, 5 in world "world"        
		send "&a&lZostałeś teleportowany do lobby"
on any move:
	set {%player%::move} to true

ale wytabować trzeba, coś mi zepsuł format

W funkcjach które zwracają wartość nie powinno się używać opóźnienia.


 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
Teraz, fabi19876 napisał:

A moszna jeszcze dodać komunikat nie ruszaj się teleportacja nastąpi z 5 sekund.

command /lobby [<text>]:
	trigger:
		set {_l} to location of player
		set {_s} to 5
		send "Nie ruszaj sie, teleportacja nastapi za 5 sekund"
		while {_s} > 0:
			if distance between {_l} and location of player > 0.1:
				send "Poruszyles sie!"
				stop
			remove 1 from {_s}
			wait second
		teleport player to location at -187, 64, 5 in world "world"        
		send "&a&lZostałeś teleportowany do lobby"

 

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