Skocz do zawartości
  • 0

Cooldown na efekt na itemie


Pytanie

Czesc wie ktos moze jak nalozyc cooldown na miecz który daje poison ale by był to cooldown na sam efekt a nie na cały miecz?

Skrypt:
on damage of player:
    if attacker is not a player:
        stop
    if attacker's tool is netherite sword:
        if name of attacker's tool is  "&2&lᴢᴀᴛʀᴜᴛʏ ᴍɪᴇᴄᴢ":
            apply potion of poison to victim for 2 seconds
        
on click:
    if players's tool is netherite sword:
        if name of players's tool is  "&2&lᴢᴀᴛʀᴜᴛʏ ᴍɪᴇᴄᴢ":
            send "test" to player

Odnośnik do komentarza
https://skript.pl/temat/57823-cooldown-na-efekt-na-itemie/
Udostępnij na innych stronach

3 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
options:
	CooldownNaMiecz: 20 seconds
	CooldownNaMieczMessage: &cNastępny raz możesz użyć go za: [TIME]!
	
	
on damage of player:
	attacker is a player
	if attacker's tool is netherite sword:
		if name of attacker's tool is "&2&lᴢᴀᴛʀᴜᴛʏ ᴍɪᴇᴄᴢ":
			if Cooldown(attacker, "ZatrutyMieczCooldown", {@CooldownNaMiecz}, "{@CooldownNaMieczMessage}") is false:
				apply potion of poison to victim for 2 seconds
        
on click:
    if players's tool is netherite sword:
        if name of players's tool is  "&2&lᴢᴀᴛʀᴜᴛʏ ᴍɪᴇᴄᴢ":
            send "test" to player 
			
			
function TimeSpan(time: text) :: text:
	set {_t} to "%{_time}%"
	replace all " minute" and " minutes" with "m" in {_t}
	replace all " days" and " day" with "d" in {_t}
	replace all " hours" and " hour" with "h" in {_t}
	replace all " minutes" and " minute" with "m" in {_t}
	replace all " seconds" and " second" with "s" in {_t}
	return {_t}
                
function Cooldown(p: player, zm: text, t: timespan, m: text) :: boolean:
    set {_z} to {%{_zm}%::%{_p}%}
    if {_z} is not set:
        set {%{_zm}%::%{_p}%} to now
        return false
    else:
        set {_time} to {%{_zm}%::%{_p}%}
        set {_plus} to {_t}
        
        add {_plus} to {_time}
        if {_time} >= now:
            replace all "[TIME]" with TimeSpan("%difference between {_time} and now%") in {_m}
            send {_m} to {_p}
            return true
        else:
            set {%{_zm}%::%{_p}%} to now
            return false

Proszę, to powinno działać.
Pozdrawiam.

Odnośnik do komentarza
https://skript.pl/temat/57823-cooldown-na-efekt-na-itemie/#findComment-343662
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ę...