Skocz do zawartości
  • 0

Skrypt na Skrzynie


Koksiak

Pytanie

Witam

Mam problem z tym oto skryptem.

on rightclick with chest:
	if player's tool is chest named "&dSlaba Wielkanocna Skrzynia":
		remove 1 chest named "&dSlaba Wielkanocna Skrzynia" from player's inventory
		set {%player%.skrzynia.i} to random integer from 1 to 10
		if {%player%.skrzynia.i} is 1
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory
		if {%player%.skrzynia.i} is 2
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocna Klata" to player's inventory
		if {%player%.skrzynia.i} is 3
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocne Spodnie" to player's inventory
		if {%player%.skrzynia.i} is 4
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocne Buty" to player's inventory
		if {%player%.skrzynia.i} is 5
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory
		if {%player%.skrzynia.i} is 6
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory
		if {%player%.skrzynia.i} is 7
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory
		if {%player%.skrzynia.i} is 8
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory
		if {%player%.skrzynia.i} is 9
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory
		if {%player%.skrzynia.i} is 10
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory

Chodzi o to, że chcę dodać żeby była szansa procentowa na każdy z itemów, np 11% na dropniecie 1 przedmiotu, 20% na dropniecie 2 przedmiotu, 1% na dropniecie 10 przedmiotu, żeby nie było losowe pomiędzy od 1 do 10.

Odnośnik do komentarza
https://skript.pl/temat/28946-skrypt-na-skrzynie/
Udostępnij na innych stronach

4 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Jest na to parę sposobów

1. (chyba najlepszy)

on rightclick with chest:
	if player's tool is chest named "&dSlaba Wielkanocna Skrzynia":
		remove 1 chest named "&dSlaba Wielkanocna Skrzynia" from player's inventory
		set {%player%.skrzynia.i} to random integer from 1 to 100
		if {%player%.skrzynia.i} is 1 or 2 or 3 or 4 or 5 or 6 or 7 or 9 or 10
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory
		if {%player%.skrzynia.i} is 11 or 12 or 13 or 14 or 15 or 16 or 17 or 18 or 19 or 20 or 21
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocna Klata" to player's inventory
		if {%player%.skrzynia.i} is 22 or 23 or 24 or 25 or 26 or 27 or 28 or 29 or 30 or 31 or 32
			add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocne Spodnie" to player's inventory
		itd....

2. (gorszy bo ten 1 przedmiot zawsze ma większe szanse na wygrana}

on rightclick with chest:
    if player's tool is chest named "&dSlaba Wielkanocna Skrzynia":
        remove 1 chest named "&dSlaba Wielkanocna Skrzynia" from player's inventory
        chance of X%:
            add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocny Helm" to player's inventory
            stop
        chance of X%:
            add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocna Klata" to player's inventory
            stop
        chance of X%:
            add 1 diamond helmet of protection 100 and thorns 25 named "&dWielkanocne Spodnie" to player's inventory
            stop
        itd....

 

Odnośnik do komentarza
https://skript.pl/temat/28946-skrypt-na-skrzynie/#findComment-191142
Udostępnij na innych stronach

  • 0

A da sie zrobic zeby dawalo tylko jeden item w tym drugim sposobie?

I jeszcze jest kilka błędów mianowicie

i"indeantation error: expected 2 tabs, but found 3 tabs..."

i  takie cos 'if {%player%.skrzynia.i}' is not an entity type...

Edytowane przez Koksiak
Odnośnik do komentarza
https://skript.pl/temat/28946-skrypt-na-skrzynie/#findComment-191144
Udostępnij na innych stronach

  • 0
16 minut temu, Koksiak napisał:

A da sie zrobic zeby dawalo tylko jeden item w tym drugim sposobie?

I jeszcze jest kilka błędów mianowicie

i"indeantation error: expected 2 tabs, but found 3 tabs..."

i  takie cos 'if {%player%.skrzynia.i}' is not an entity type...

da sie

i"indeantation error: expected 2 tabs, but found 3 tabs..." dodaj na końcu " : "
if {%player%.skrzynia.i} is 1 or 2 or 3 or 4 or 5 or 6 or 7 or 9 or 10:

Edytowane przez xAxee
Odnośnik do komentarza
https://skript.pl/temat/28946-skrypt-na-skrzynie/#findComment-191147
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ę...