Skocz do zawartości
  • 0

naprawi ktos skrypt z losowa liczba kasy pod /daily?


Pytanie

command /daily:     cooldown: 1 day     cooldown message: &7Odebrales juz &edzisiejsza &7nagrode!     trigger:         chance off 10%:         add 0.1 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.1 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.1 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.08 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.08 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.08 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.17 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.17 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.17 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.37 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.37 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.37 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.03 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.03 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.03 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.84 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.84 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.84 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.54 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.54 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.54 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.11 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.11 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.11 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.08 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.08 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.08 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         chance off 10%:         add 0.69 to {kasa.%player%}         send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.69 &7PLN!" to player         send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.69 &7PLN! &8(&7/daily&8)" to all players         launch creeper firework colored yellow at player timed 1         stop

Odnośnik do komentarza
https://skript.pl/temat/54400-naprawi-ktos-skrypt-z-losowa-liczba-kasy-pod-daily/
Udostępnij na innych stronach

3 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 1

A co tu nie działa?

I na litość boską zapisz to normalnie, bo gdy chce sie skopiowac do notatnika to układa sie to wszystko w 1 linijce

Nie uzywaj {kasa.%player%} tylko {kasa::%player%}, jest to bardziej optymalne.

Poza tym ekonomie masz w essentialsie , wiec po co zasmiecac serwer niepotrzebna zmienna? Potrzebujesz jedynie plugina vault 

Odnośnik do komentarza
https://skript.pl/temat/54400-naprawi-ktos-skrypt-z-losowa-liczba-kasy-pod-daily/#findComment-330096
Udostępnij na innych stronach

  • 0

Po 1:
tragicznie wkejony kod
po 2:
takie coś jak chance off nie istenieje jest chance of

po 3:
używając 10 razy pod rząd chance of 10% nie uzyskujesz losowania z prawdopodobienstwiem 10% wygranej ponieważ masz 10 losowań z prawdopodobienstwem wygranej

po 4:
jeżeli już chcesz 10% na różne rzeczy polecam setować zmienną tymczasową na random liczbe w zakresie 1-10 (szansa na wypadnięcie konkretnej liczby to 1/10 czylio 10%)

oto poprawiony kod:
 

command /daily: 	
	cooldown: 1 second
 	
	cooldown message: &7Odebrales juz &edzisiejsza &7nagrode! 	
	trigger: 	
		set {_nagroda} to random integer between 1 and 10
		if {_nagroda} is 1:

			add 0.1 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.1 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.1 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 2: 	

			add 0.08 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.08 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.08 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 3: 	

			add 0.17 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.17 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.17 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 4:
		
			add 0.37 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.37 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.37 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 5: 	

			add 0.03 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.03 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.03 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 6: 	

			add 0.84 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.84 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.84 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 7: 	

			add 0.54 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.54 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.54 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 8: 	

			add 0.11 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.11 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.11 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 9: 	

			add 0.08 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.08 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.08 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		if {_nagroda} is 10: 	

			add 0.69 to {kasa.%player%} 	
			send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e0.69 &7PLN!" to player 	
			send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%player% &7wlasnie wygral &e0.69 &7PLN! &8(&7/daily&8)" to all players 	
			launch creeper firework colored yellow at player timed 1 	
		stop

i polecam zamienić we wszystkich skryptach z kasą 
 

 {kasa.%player%}

na 

{kasa::%player%}


Liczę na like i zagłosowanie na najlepsza odpowiedź gdzyż ponieważ musialem się męczyć z tym czymś co wysałeś nie wstawionym w code tylko w 1 linijce...

Odnośnik do komentarza
https://skript.pl/temat/54400-naprawi-ktos-skrypt-z-losowa-liczba-kasy-pod-daily/#findComment-330107
Udostępnij na innych stronach

  • 0

Tutaj trochę skrócony kod 

 

Spoiler

command /daily:     
    cooldown: 1 second
    cooldown message: &7Odebrales juz &edzisiejsza &7nagrode!     
    trigger:     
        set {_nagroda} to random integer between 1 and 10
        if {_nagroda} is 1:
            nagroda(player, 0.1)
        else if {_nagroda} is 2:     
            nagroda(player, 0.08)
        else if {_nagroda} is 3:     
            nagroda(player, 0.17)
        else if {_nagroda} is 4:
            nagroda(player, 0.37)    
        else if {_nagroda} is 5:     
            nagroda(player, 0.03)    
        else if {_nagroda} is 6:     
            nagroda(player, 0.84)
        else if {_nagroda} is 7: 
            nagroda(player, 0.54)    
        else if {_nagroda} is 8:     
            nagroda(player, 0.11)
        else if {_nagroda} is 9:     
            nagroda(player, 0.08)
        else if {_nagroda} is 10:     
            nagroda(player, 0.69)

function nagroda(p: player, n: number):
    add {_n} to {kasa.%{_p}%} 
    send title "&e&lTWO&f&lCASH.PL" with subtitle "&7Gratulacje, wygrales w nagrodzie &e%{_n}% &7PLN!" to {_p}
    send "&e&lTWO&f&lCASH.PL &8&l| &7Gratulacje, &e%{_p}% &7wlasnie wygral &e0.69 &7PLN! &8(&7/daily&8)" to all players     
    launch creeper firework colored yellow at {_p} timed 1     
 

 

Odnośnik do komentarza
https://skript.pl/temat/54400-naprawi-ktos-skrypt-z-losowa-liczba-kasy-pod-daily/#findComment-330108
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Nieaktywny
Odpowiedz na pytanie...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...