Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Pytanie] Losowa liczba w craftingu /skrypt.


Rekomendowane odpowiedzi

Opublikowano

No siemka ;d..

Nie wiedziałem jak to dokładnie określić więc temat jest troche dziwny ale do rzeczy. Mam skrypt na cobbleX i chciałbym aby gdy scraftujemy tego cobbleX z 9 stacków cobla wypadała nam jego losowa liczba od 1 do 3.

Tutaj skrypt na crafting

 
 
on load:
new Recipe "1";
"1".Recipe.registerIngredient{1, 64 cobblestone};
"1".Recipe.registerIngredient{2, 64 cobblestone};
"1".Recipe.registerIngredient{3, 64 cobblestone};
"1".Recipe.registerIngredient{4, 64 cobblestone};
"1".Recipe.registerIngredient{5, 64 cobblestone};
"1".Recipe.registerIngredient{6, 64 cobblestone};
"1".Recipe.registerIngredient{7, 64 cobblestone};
"1".Recipe.registerIngredient{8, 64 cobblestone};
"1".Recipe.registerIngredient{9, 64 cobblestone};
"1".Recipe.registerResult{1 emerald ore of Sharpness 1 named "&7Cobble&2X"};
"1".Recipe.register{};
 
z góry dzięki za pomoc ;d
Opublikowano

Ale tutaj nie ma tego o co mi chodzi ;d. Ja chce aby po skraftowaniu wypadała mi losowa liczba cobbleX od 1-3

 

Opublikowano

on crafting:

 set {value} to 1 or 2 or 3

 if {value} is 1:

   drop 1 cobblestone at player

   stop

 if {value} is 2:

  drop 2 cobblestone at player

  stop

if {value} is 3:

  drop 3 cobblestone at player

  stop

sygnatura.png

Opublikowano

Nie testowałem, ale powinno działać: 

on crafting:
            set {los} to random number between 1 and 3
            if {los} is 1:
            give player 1 emerald ore of sharpness 1 named "&7Cobble&2X"
            if {los} is 2:
            give player 2 emerald ore of sharpness 1 named "&7Cobble&2X"
            if {los} is 3:
            give player 3 emerald ore of sharpness 1 named "&7Cobble&2X"


@Edit

@1361622928-U485574.pngNeshu

Jak będę miał czas to naprawię :)

sseekj.jpg

Opublikowano

@kubaplichta280

Tutaj masz caly skrypt zrobisz tak zeby dzialal ;cc ?

 

on load:
   new Recipe "1";
    "1".Recipe.registerIngredient{1, 64 cobblestone};
    "1".Recipe.registerIngredient{2, 64 cobblestone};
    "1".Recipe.registerIngredient{3, 64 cobblestone};
    "1".Recipe.registerIngredient{4, 64 cobblestone};
    "1".Recipe.registerIngredient{5, 64 cobblestone};
    "1".Recipe.registerIngredient{6, 64 cobblestone};
    "1".Recipe.registerIngredient{7, 64 cobblestone};
    "1".Recipe.registerIngredient{8, 64 cobblestone};
    "1".Recipe.registerIngredient{9, 64 cobblestone};
    "1".Recipe.registerResult{1 emerald ore of sharpness 1 named "&7Cobble&2X"};
    "1".Recipe.register{};
 
on rightclick with emerald ore:
    player is holding a emerald ore of Sharpness 1 named "&7Cobble&2X":
        cancel event
        remove emerald ore of Sharpness 1 named "&7Cobble&2X" from player
        if chance of 4%:
            give 1 Emerald Ore of Sharpness 1 named "&7Cobble&2X" to player
            send " &aDostales CobbleX"
        if chance of 4%:
            give 1 ender pearl to the player
            send " &aDostales perle! "
        if chance of 4%:
            give 1 enchanted golden apple to the player
            send " &aDostales KOX'a!"
        if chance of 4%:
            give 1 TNT to the player
            send " &aDostales TNT!"
        if chance of 4%:
            give 1 Glowstone Dust to the player
            send " &aDostales swiecacy proszek!"
        if chance of 4%:
            give 1 Nether Wart to the player
            send " &aDostales brodawke!"
        if chance of 4%:
            give 1 Apple to the player
            send " &aDostales jablko!"
        if chance of 4%:
            give 1 arrow to the player
            send " &aDostales strzale!"
        if chance of 4%:
            give Melon  to the player
            send " &aDostales arbuza!"
        if chance of 4%:
            give 1 enchanted golden apple to the player
            send " &aDostales KOX'a!"
        if chance of 4%:
            give 1 Golden Apple to the player
            send " &aDostales zlote jablko!"
        if chance of 4%:
            give 1 Blaze Rod to the player
            send " &aDostales palke blaze!"
        if chance of 4%:
            give 1 Book to the player
            send " &aDostales ksiazke!"
        if chance of 4%:
            give 1 Rotten Flesh to the player
            send " &aDostales zgnile mieso!"
        if chance of 4%:
            give 1 carrot to the player
            send " &aDostales marchewke!"
        if chance of 4%:
            give 1 sugar cane to the player
            send " &aDostales trzcine!"
        if chance of 4%:
            give 1 gold block to the player
            send " &aDostales blok zlota!"
        if chance of 4%:
            give 1 slimeball to the player
            send " &aDostales slimeball!"
        if chance of 4%:
            give 1 leather to the player
            send " &aDostales skore!"
        if chance of 4%:
            give 1 diamond block to the player
            send " &aDostales blok diamentu!"
        if chance of 1%:
            give 1 bow of power 4 to the player
            send " &aDostales luk!"
        if chance of 4%:
            give 1 diamond sword of sharpness 4 to the player
            send " &aDostales miecz!"
        if chance of 4%:
            give 1 mycelium to the player
            send " &aDostales grzybnie!"
        if chance of 4%:
            give 1 redstone to the player
            send " &aDostales redstone!"
        if chance of 100%:
            give 1 string to the player
            send " &aDostales nić!"
Opublikowano

 

@kubaplichta280

Tutaj masz caly skrypt zrobisz tak zeby dzialal ;cc ?

 

on load:
   new Recipe "1";
    "1".Recipe.registerIngredient{1, 64 cobblestone};
    "1".Recipe.registerIngredient{2, 64 cobblestone};
    "1".Recipe.registerIngredient{3, 64 cobblestone};
    "1".Recipe.registerIngredient{4, 64 cobblestone};
    "1".Recipe.registerIngredient{5, 64 cobblestone};
    "1".Recipe.registerIngredient{6, 64 cobblestone};
    "1".Recipe.registerIngredient{7, 64 cobblestone};
    "1".Recipe.registerIngredient{8, 64 cobblestone};
    "1".Recipe.registerIngredient{9, 64 cobblestone};
    "1".Recipe.registerResult{1 emerald ore of sharpness 1 named "&7Cobble&2X"};
    "1".Recipe.register{};
 
on rightclick with emerald ore:
    player is holding a emerald ore of Sharpness 1 named "&7Cobble&2X":
        cancel event
        remove emerald ore of Sharpness 1 named "&7Cobble&2X" from player
        if chance of 4%:
            give 1 Emerald Ore of Sharpness 1 named "&7Cobble&2X" to player
            send " &aDostales CobbleX"
        if chance of 4%:
            give 1 ender pearl to the player
            send " &aDostales perle! "
        if chance of 4%:
            give 1 enchanted golden apple to the player
            send " &aDostales KOX'a!"
        if chance of 4%:
            give 1 TNT to the player
            send " &aDostales TNT!"
        if chance of 4%:
            give 1 Glowstone Dust to the player
            send " &aDostales swiecacy proszek!"
        if chance of 4%:
            give 1 Nether Wart to the player
            send " &aDostales brodawke!"
        if chance of 4%:
            give 1 Apple to the player
            send " &aDostales jablko!"
        if chance of 4%:
            give 1 arrow to the player
            send " &aDostales strzale!"
        if chance of 4%:
            give Melon  to the player
            send " &aDostales arbuza!"
        if chance of 4%:
            give 1 enchanted golden apple to the player
            send " &aDostales KOX'a!"
        if chance of 4%:
            give 1 Golden Apple to the player
            send " &aDostales zlote jablko!"
        if chance of 4%:
            give 1 Blaze Rod to the player
            send " &aDostales palke blaze!"
        if chance of 4%:
            give 1 Book to the player
            send " &aDostales ksiazke!"
        if chance of 4%:
            give 1 Rotten Flesh to the player
            send " &aDostales zgnile mieso!"
        if chance of 4%:
            give 1 carrot to the player
            send " &aDostales marchewke!"
        if chance of 4%:
            give 1 sugar cane to the player
            send " &aDostales trzcine!"
        if chance of 4%:
            give 1 gold block to the player
            send " &aDostales blok zlota!"
        if chance of 4%:
            give 1 slimeball to the player
            send " &aDostales slimeball!"
        if chance of 4%:
            give 1 leather to the player
            send " &aDostales skore!"
        if chance of 4%:
            give 1 diamond block to the player
            send " &aDostales blok diamentu!"
        if chance of 1%:
            give 1 bow of power 4 to the player
            send " &aDostales luk!"
        if chance of 4%:
            give 1 diamond sword of sharpness 4 to the player
            send " &aDostales miecz!"
        if chance of 4%:
            give 1 mycelium to the player
            send " &aDostales grzybnie!"
        if chance of 4%:
            give 1 redstone to the player
            send " &aDostales redstone!"
        if chance of 100%:
            give 1 string to the player
            send " &aDostales nić!"

 

dopisz do swojego skryptu skrypt @kubaplichta280 i już

2x%20zakazana%20sygnatura.png


76561198266836735.png


 

Opublikowano

@jacekssj

jakby po dopisaniu mi działało to bym nie kontynuowal tego tematu -.-

aha ok no to muszę się zastanowić

@Edit a ten wyżej ci działa?

2x%20zakazana%20sygnatura.png


76561198266836735.png


 

Opublikowano
on rightclick on a craftable:
    set {_los} to random integer between 1 and 3
on load:
   new Recipe "1";
    "1".Recipe.registerIngredient{1, 64 cobblestone};
    "1".Recipe.registerIngredient{2, 64 cobblestone};
    "1".Recipe.registerIngredient{3, 64 cobblestone};
    "1".Recipe.registerIngredient{4, 64 cobblestone};
    "1".Recipe.registerIngredient{5, 64 cobblestone};
    "1".Recipe.registerIngredient{6, 64 cobblestone};
    "1".Recipe.registerIngredient{7, 64 cobblestone};
    "1".Recipe.registerIngredient{8, 64 cobblestone};
    "1".Recipe.registerIngredient{9, 64 cobblestone};
    "1".Recipe.registerResult{{_los} emerald ore of sharpness 1 named "&7Cobble&2X"};
    "1".Recipe.register{};

Tak powinno działać

TEMAT


 


Opublikowano
on rightclick on a crafting table:
    set {_los} to random integer between 1 and 3
on load:
   new Recipe "1";
    "1".Recipe.registerIngredient{1, 64 cobblestone};
    "1".Recipe.registerIngredient{2, 64 cobblestone};
    "1".Recipe.registerIngredient{3, 64 cobblestone};
    "1".Recipe.registerIngredient{4, 64 cobblestone};
    "1".Recipe.registerIngredient{5, 64 cobblestone};
    "1".Recipe.registerIngredient{6, 64 cobblestone};
    "1".Recipe.registerIngredient{7, 64 cobblestone};
    "1".Recipe.registerIngredient{8, 64 cobblestone};
    "1".Recipe.registerIngredient{9, 64 cobblestone};
    "1".Recipe.registerResult{{_los} emerald ore of sharpness 1 named "&7Cobble&2X"};
    "1".Recipe.register{};

A tak, dość dziwnie, ja zrobiłbym to inaczej ale ok

TEMAT


 


Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...