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

[Pastes] Skripty uBera & tutoriale dot. skript


Rekomendowane odpowiedzi

Opublikowano

Od kilku dni piszę skrypty, jedne są łatwiejsze drugie zaś trudniejsze. No nic. Skript jest 'językiem' do psiania mini-pluginów do bukkita, wystarczy znajomość angielskiego i tak na prawdę pomysł na to co chcemy zrobić. Wykorzystuje świetną metodę zapisu danych. Przykładowy skript na drop'fixa szkła:

 

on break:
    block is 20:
        drop 20 at block
Wystarczy przetłumaczyć sobie na polski
po zniszczeniu:
    blok to 20(szkło):
       wyrzuć 20[szkło] w miejscu bloku
[/code]

Odsyłam was do pelnej dokumentacji 
http://njol.ch/projects/skript/doc/
Tutaj jest dosłownie wszystko. Moje skripty Skript na zliczanie śmierci oraz zabić gracza, komenda /staty sprawdzająca Twoje staty lub staty kogoś innego.

variables:
    {kill.%player%} = 0
    {smierc.%player%} = 0
    {played.%player%} = 0
    {ratio.%player%} = 0
on death:
    attacker is a player
    victim is a player
    add 1 to {smierc.%victim%}
    add 1 to {kill.%attacker%}
    message "&cZabiles Gracza &b%victim%" to attacker
    message "&cZostales zabity przez &b%attacker%" to victim
command /staty [<player>]:
    description: Sprawdza swoje stats
    trigger:
        if argument 1 is not set:
            #{ratio.%player%} = {kill.%player%}/{smierc.%player%}
            message "&fAktualnie zabiles &3&l%{kill.%player%}% osob"
            message "&fAktualnie zginales &c&l%{smierc.%player%}% razy"
            #message "&fRatio &6 %player%&r: &c&l{ratio.%player%}"
        if {played.%argument 1%} is true:
            #{ratio.%argument 1%} = {kill.%argument 1%}/{smierc.%argument 1%}
            message "&fZabicia &6 %arg%&r: &3&l%{kill.%argument 1%}%"
            message "&fSmierci &6 %arg%&r: &c&l%{smierc.%argument 1%}%"
            #message "&fRatio &6 %arg%&r: &c&l{ratio.%argument 1%}"
        if {played.%argument 1%} is false:
            if {played.%player%} is false:
                message "<green><bold>%argument 1%<reset><light greeen> nigdy nie gral na tym serwerze!"
                
on first join:
    set {played.%player%} to true
        

OtherDrop
  • większy exp dla gracza z perm vip.exp
  • większa szansa na drop dla gracza z perm vip.drop
  • działająca fortuna dająca x2

 

 

options:
    diament: 0.8%
    zelazo: 1.1%
    zloto: 1.1%
    diaxvip: 1.3%
    ironvip: 1.6%
    zlotovip: 1.6%
    exp: 162
    
variables:
    {diament2} = true
    {zelazo2} = true
    {zloto2} = true
 
 
On Break Of Stone:
    if player has permission "vip.exp":
        execute console command "/xp 210 %name of player%"
        stop
    else:
        execute console command "/xp {@exp} %name of player%"
        stop        
    
On Mine Of Stone:
    if {diament2} is true:
        if player has permission "vip.drop":
            chance of {@diaxvip}:
                message "&bWykopales diament! <-- VIP!"
                drop a diamond
                stop
        if tool of the player is enchanted with fortune:
            chance of {@diaxvip}:
                message "&bWykopales diament z fortuna!"
                drop a diamond
                drop a diamond
                stop
        else:
            chance of {@diament}:
                message "&bWykopales diament!"
                drop a diamond
                stop
    if {zelazo2} is true:
        if player has permission "vip.drop":
            chance of {@ironvip}:
                message "&bWykopales zelazo! <-- VIP!"
                drop a iron ore
                stop
        if tool of the player is enchanted with fortune:
            chance of {@ironvip}:
                message "&bWykopales zelazo z fortuna!"
                drop a iron ore
                drop a iron ore
                stop
        else:
            chance of {@zelazo}:
                message "&bWykopales zelazo!"
                drop a iron ore
                stop
    if {zloto2} is true:
        if player has permission "vip.drop":
            chance of {@zlotovip}:
                message "&bWykopales zelazo! <-- VIP!"
                drop a iron ore
                stop
        if tool of the player is enchanted with fortune:
            chance of {@zlotovip}:
                message "&bWykopales zelazo z fortuna!"
                drop a iron ore
                drop a iron ore
                stop
        else:
            chance of {@zloto}:
                message "&bWykopales zloto!"
                drop a iron ore
                stop
 
            
On Mine Of Diamond Ore or Iron Ore or Gold Ore:
    if {diament2} is true:
        cancel event
        set block to stone
        message "<light red>Surowce (zloto, zelazo, diament) <light green> wypadaja tylko z <grey>kamienia! <light green>Wiecej informacji: <yellow><bold>/drop<reset>"
        stop
    
 
        
command /drop:
    description: Pokazuje drop ze stone
    trigger:
        message "&2=====Drop====="
        message "&bDiament: 0.8 procent | VIP: 1.3 procent"
        message "&fZelazo: 1.1 procent | VIP: 1.5 procent"
        message "&eZloto: 1.1 procent | VIP: 1.5 procent"
        message "&2=====Drop====="
        stop
        
command /drops [<text>]:
    description: Wlaczanie i wylaczanie rud
    permission: drop.wliwyl
    trigger:
        if argument 1 is "diament":
            if {diament2} is true:
                set {diament2} to false
                message "&bWylaczono wypadanie diamentu"
                stop
            if {diament2} is false:
                set {diament2} to true
                message "&bWlaczono wypadanie diamentu"
                stop
        if argument 1 is "zelazo":
            if {zelazo2} is true:
                set {zelazo2} to false
                message "&fWylaczono wypadanie zelaza"
                stop
            if {zelazo2} is false:
                set {zelazo2} to true
                message "&fWlaczono wypadanie zelaza"
                stop
        if argument 1 is "zloto":
            if {zloto2} is true:
                set {zloto2} to false
                message "&eWylaczono wypadanie zlota"
                stop
            if {zloto2} is false:
                set {zloto2} to true
                message "&eWlaczono wypadanie zlota"
                stop
        if argument 1 is "list":
            message "&bdiament"
            message "&fzelazo"
            message "&ezloto"
            stop

 

 

 

Skript pozwala też na łatwe tworzenie komend, tak wygląda struktura:

 

 

command /costam [<text>] [<player>]
  trigger:
    set {%argument 1%.%argument 2%} to true

 

Argumenty to

1 - text (dowolny ciąg znaków)

2 - player (nick gracza on-line)

 

Przykład na blokadach /pl, /help, /plugins i /?

 

 

command /pl:
    trigger:
        send "<green>Lepiej zebys nie wiedzial."
command /plugins:
    trigger:
        send "<green>Lepiej zebys nie wiedzial."
command /op [<text>]:
    trigger:
        if argument 1 is not set:
            send "<green>Lepiej zebys jednak tego OPa nie mial =D."
        else:
            send "<green>Lepiej zebys jednak tego OPa nie mial =D."
            
command /help [<text>]:
    trigger:
        if argument 1 is not set:
            send "<green>Lepiej zebys nie wiedzial."
        else:
            send "<green>Lepiej zebys nie wiedzial."
            
command /? [<text>]:
    trigger:
        if argument 1 is not set:
            send "<green>Lepiej zebys nie wiedzial."
        else:
            send "<green>Lepiej zebys nie wiedzial."
  • 2 miesiące temu...

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...