Skript error

Technická podpora k herním serverům Minecraft a Tekkit
Message
Autor
Uživatelský avatar
Ritchy
Příspěvky: 219
Registrován: 07 čer 2016, 17:14
Reputation: 2

Re: Skript error

#21 Příspěvekod Ritchy » 21 pro 2017, 15:56

Podle čeho tam mám dát ty mezery?
Nezapomeň mi dát K+, pokud jsem ti pomohl! :)

ZiDyPL
Příspěvky: 295
Registrován: 13 dub 2015, 22:01
Reputation: 17

Re: Skript error

#22 Příspěvekod ZiDyPL » 22 pro 2017, 09:21

Podle logiky a dvojteček - v řádku po dvojtečce je o jedno vyšší odsazení. Odsazení si zvol mezery, víc mezer, nebo taby. Kód pak bude vypadat třeba takto:

Kód: Vybrat vše

on join:
  player's balance is bigger than 9 #předchozí řádek končí dvojtečkou - zvyšuji odsazení
  send "Jsi stastny clovek" #nezvyšuji odsazení
  if player has permission "jsem.administrator":
    send "&4Jsi dokonce admin!" #předchozí řádek opět končí dvojtečkou - zvyšujeme odsazení
  else: #pozor, snižujeme odsazení, protože else je na stejné úrovni jako if
    message "Nejsi admin :(" #opět zvyšujeme odsazení kvůli dvojtečce

V kódu jsem používal jako odsazení 2 mezery.

Uživatelský avatar
Ritchy
Příspěvky: 219
Registrován: 07 čer 2016, 17:14
Reputation: 2

Re: Skript error

#23 Příspěvekod Ritchy » 23 pro 2017, 09:41

Zidy,
Udělal by sis prosím čas že bys mi tam ty mezery udělal? Dal bych ti třeba nějakou finanční odměnu.
Nezapomeň mi dát K+, pokud jsem ti pomohl! :)

ZiDyPL
Příspěvky: 295
Registrován: 13 dub 2015, 22:01
Reputation: 17

Re: Skript error

#24 Příspěvekod ZiDyPL » 24 pro 2017, 00:03

Promiň, ale ne. Napsal jsem jednoduchý návod, měl bys to zvládnout.

Uživatelský avatar
Ritchy
Příspěvky: 219
Registrován: 07 čer 2016, 17:14
Reputation: 2

Re: Skript error

#25 Příspěvekod Ritchy » 27 led 2018, 09:28

A co na to potřebuju za add-ony prosím?
Aby mi to fungovalo
Nezapomeň mi dát K+, pokud jsem ti pomohl! :)

Uživatelský avatar
Ritchy
Příspěvky: 219
Registrován: 07 čer 2016, 17:14
Reputation: 2

Re: Skript error

#26 Příspěvekod Ritchy » 27 led 2018, 09:32

Kód: Vybrat vše

on script load:
  uses old loops

# {passblock_write::hrac} - k jakemu indexu pise hrac heslo
# {passblock_pass::index} - jake heslo je nastaveno ("" pokud neni)
# {passblock_loc::index} - lokace PassBlocku
# {passblock_time::index} - kolik casu zbyva do promeny zpet na iron block

on skript load:
  delete {passblock_write::*}

on join:
  delete {passblock_write::%event-player%}

every tick:
  loop {passblock_time::*}:
    subtract 1 from {passblock_time::%loop-index%}
    if {passblock_time::%loop-index%} <= 0:
      set block at {passblock_loc::%loop-index%} to iron block
      delete {passblock_time::%loop-index%}

on place:
  if lore of player's tool contains "PassBlock":
    if world is not "Earth" or "PVP" or "World":
      cancel event
      message "&cPassBlock funguje jen v Survival OverWorldu!"
    if lore of player's tool contains "PassBlock":
      message "&aPassBlock byl polozen!"
      message "&2Klikni na nej pravym pro nastaveni hesla"
      add "" to {passblock_pass::*}
      add event-block's location to {passblock_loc::*}

on break:
  loop {passblock_loc::*}:
    if event-block's location is loop-value:
      set {_index} to "%loop-index%"
  if {_index} is not set:
    exit trigger
  delete {passblock_pass::%{_index}%}
  delete {passblock_loc::%{_index}%}
  delete {passblock_time::%{_index}%}
  loop {passblock_write::*}:
    if "%loop-value%" is {_index}:
      delete {passblock_write::%loop-index%}
      message "&cZadavani hesla zruseno, block byl znicen!" to "%loop-index%" parsed as player
  set block at event-block's location to air
  drop iron block named "&bPassBlock" with lore "&ePassBlock||&7Poloz tento blok na zem a klikni na nej||&7pravym tlacitkem mysi k nastaveni hesla!"

on right click on iron block:
  loop {passblock_loc::*}:
    if event-block's location is loop-value:
      set {_index} to "%loop-index%"
  if {_index} is not set:
    exit trigger
  set {passblock_write::%event-player%} to {_index}
  cancel event
  if length of {passblock_pass::%{_index}%} is 0:
    message "&e&lNapis nove heslo pro tento PassBlock:"
  else:
    message "&e&lZadej heslo:"

on chat:
  # Pokud dela neco s PassBlockem
  if {passblock_write::%event-player%} is set:
    cancel event
    # Zvaliduje heslo
    set {_test} to "%message%"
    replace all "a" in {_test} with ""
    replace all "b" in {_test} with ""
    replace all "c" in {_test} with ""
    replace all "d" in {_test} with ""
    replace all "e" in {_test} with ""
    replace all "f" in {_test} with ""
    replace all "g" in {_test} with ""
    replace all "h" in {_test} with ""
    replace all "i" in {_test} with ""
    replace all "j" in {_test} with ""
    replace all "k" in {_test} with ""
    replace all "l" in {_test} with ""
    replace all "m" in {_test} with ""
    replace all "n" in {_test} with ""
    replace all "o" in {_test} with ""
    replace all "p" in {_test} with ""
    replace all "q" in {_test} with ""
    replace all "r" in {_test} with ""
    replace all "s" in {_test} with ""
    replace all "t" in {_test} with ""
    replace all "u" in {_test} with ""
    replace all "v" in {_test} with ""
    replace all "w" in {_test} with ""
    replace all "x" in {_test} with ""
    replace all "y" in {_test} with ""
    replace all "z" in {_test} with ""
    replace all "0" in {_test} with ""
    replace all "1" in {_test} with ""
    replace all "2" in {_test} with ""
    replace all "3" in {_test} with ""
    replace all "4" in {_test} with ""
    replace all "5" in {_test} with ""
    replace all "6" in {_test} with ""
    replace all "7" in {_test} with ""
    replace all "8" in {_test} with ""
    replace all "9" in {_test} with ""
    if length of {_test} > 0:
      message "&cHeslo obsahuje nepovolene znaky"
      message "&6Zadavani hesla zruseno"
      delete {passblock_write::%event-player%}
      exit trigger
    if length of "%message%" > 15:
      message "&cHeslo muze obsahovat max 15 znaku"
      message "&6Zadavani hesla zruseno"
      delete {passblock_write::%event-player%}
      exit trigger

    # Nastavuje nove heslo
    if length of {passblock_pass::%{passblock_write::%event-player%}%} is 0:
      set {passblock_pass::%{passblock_write::%event-player%}%} to "%message%"
      message "&aHeslo uspesne nastaveno na &6%message%"
      delete {passblock_write::%event-player%}

    # Zadava heslo
    else:
      if "%message%" is {passblock_pass::%{passblock_write::%event-player%}%}:
        message "&bHeslo prijato!"
        set block at {passblock_loc::%{passblock_write::%event-player%}%} to redstone block
        set {passblock_time::%{passblock_write::%event-player%}%} to 30
        delete {passblock_write::%event-player%}
      else:
        message "&cZadane heslo je nespravne"
        message "&6Zadavani hesla zruseno"
        delete {passblock_write::%event-player%}

# aby nesly posouvat PassBlocky pres piston
on piston extend:
  set {_test} to 0
  loop 12 times:
    add 1 to {_test}
    set {_loc} to block {_test} blocks in front of the event-block
    loop {passblock_loc::*}:
      if location of {_loc} is loop-value:
        cancel event
        exit trigger

# aby pri zniceni PassBlocku zmizly promenne
On explode:
  loop exploded blocks:
    delete {_index}
    loop {passblock_loc::*}:
      if loop-block's location is loop-value:
        set {_index} to "%loop-index%"
    if {_index} is set:
      delete {passblock_pass::%{_index}%}
      delete {passblock_loc::%{_index}%}
      delete {passblock_time::%{_index}%}
      loop {passblock_write::*}:
        if "%loop-value%" is {_index}:
          delete {passblock_write::%loop-index%}
          message "&cZadavani hesla zruseno, block byl znicen!" to "%loop-index%" parsed as player
Nezapomeň mi dát K+, pokud jsem ti pomohl! :)


Zpět na „Minecraft, Tekkit“

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 26 hostů