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] Jak zabezpieczyć skrzynie itp. w skrypcie?


Rekomendowane odpowiedzi

Opublikowano

W związku z tym iż LWC ostatnio szwankuje na spigot musiałem go bezpowrotnie usunąć.

I teraz pojawia się problem. Jak to zrobić tak aby było dobrze.

 

Moje pytanie a zarazem problem jak taki/e czy da się wykonać skrypt, w którym każdy na serwerze będzie mógł zabezpieczyć swoją skrzynie, drzwi oraz piec.

 

//Edit

Oczywiście w pluginie Skript.

Opublikowano

Nie jestem tego do końca pewny, ale chyba zamiast LWC można użyć EssentialsProtect?

Opublikowano

O coś takiego ci chodzi?:
 

​options:
 # Nazwa wyświetlana przed wszystkimi komunikatami
        tag: &a[Lock]&b
       
 # UWAGA - MAKSYMALNA WARTOŚĆ W ilosc.graczy TO 6!!!! Ilość graczy jaka może mieć dostęp do skrzynki - razem z właścicielem - w tym wypadku właściciel i 5 znajomych.
        ilosc.graczy: 6
       
 # Wiadomości:
        set.lock: Zalozono blokade
        open.chest: Otworzyles zabezpieczona skrzynie
        nprm: Nie masz uprawnien
        brkch: Najpierw zniszcz blokade
        antigrief: Zabezpieczenie anty grief - aby zniszczyc blok najpierw odblokuj skrzynke nad nim
        del.lock: Usunieto blokade
       
on explode:
        loop blocks in radius 8 of event-location:
                {chest.%location of loop-block%} is location of loop-block:
                        cancel event
                {sign.%location of loop-block%} is location of loop-block:
                        cancel event
on sign change:
        if block behind event-block is chest:
                if {chest.%location of block behind event-block%} is not set:
                        set line 1 of event-block to "[Blokada]"
                        set line 2 of event-block to "%name of player%"
                        set {chest.%location of block behind event-block%} to location of block behind event-block
                        add name of player to {baza.%location of event-block%::*}
                        set {sign.%location of event-block%} to location of event-block
                        send "{@tag} {@set.lock}"
                        loop blocks in radius 1 of block behind event-block:
                                if loop-block is chest:
                                        if block above loop-block is not event-block:
                                                if block over loop-block is not event-block:
                                                        if {chest.%location of loop-block%} is not set:
                                                                set {chest.%location of loop-block%} to location of loop-block
on rightclick on chest:
        if {chest.%location of event-block%} is location of event-block:
                if {sign.%location of block forward event-block%} is location of block forward event-block:
                        loop {baza.%location of block forward event-block%::*}:
                                loop-value is name of player:
                                        send "{@tag} {@open.chest}"
                                        stop
                        cancel event
                        send "{@tag} {@nprm}"
                else:
                        loop blocks in radius 1 of event-block:
                                if loop-block is chest:
                                        if {chest.%location of loop-block%} is location of loop-block:
                                                if block above loop-block is not event-block:
                                                        if block over loop-block is not event-block:
                                                                loop blocks in radius 1 of loop-block-1:
                                                                        if {sign.%location of block forward loop-block-2%} is location of block forward loop-block-1:
                                                                                if block above loop-block-2 is not loop-block-1:
                                                                                        if block over loop-block-2 is not loop-block-1:
                                                                                                loop {baza.%location of block forward loop-block-2%::*}:
                                                                                                        loop-value is name of player:
                                                                                                                send "{@tag} {@open.chest}"
                                                                                                                stop
                                                                                                cancel event
                                                                                                send "{@tag} {@nprm}"
on break of chest:
        if {chest.%location of event-block%} is location of event-block:
                if {sign.%location of block forward event-block%} is location of block forward event-block:
                        if {baza.%location of block forward event-block%::1} is name of player:
                                send "{@tag} {@brkch}"
                                cancel event
                        else:
                                send "{@tag} {@nprm}"
                                cancel event
                else:
                        loop blocks in radius 1 of event-block:
                                if loop-block is chest:
                                        if {chest.%location of loop-block%} is location of loop-block:
                                                if block above loop-block is not event-block:
                                                        if block over loop-block is not event-block:
                                                                loop blocks in radius 1 of loop-block-1:
                                                                        if {sign.%location of loop-block-2%} is location of block forward loop-block-1:
                                                                                if block above loop-block-2 is not loop-block-1:
                                                                                        if block over loop-block-2 is not loop-block-1:
                                                                                                if {baza.%location of loop-block-2%::1} is name of player:
                                                                                                        send "{@tag} {@brkch}"
                                                                                                        cancel event
                                                                                                else:
                                                                                                        send "{@tag} {@nprm}"
                                                                                                        cancel event
on break:
        if {chest.%location of block above event-block%} is location of block above event-block:
                send "{@tag} {@antigrief}"
                cancel event
on break of sign:
        if {sign.%location of event-block%} is location of event-block:
                if line 1 of event-block is "[Blokada]":
                        if {baza.%location of event-block%::1} is name of player:
                                delete {sign.%location of event-block%}
                                delete {baza.%location of event-block%::*}
                                delete {chest.%location of block behind event-block%}
                                loop blocks in radius 1 of block behind event-block:
                                        if loop-block is chest:
                                                if {chest.%location of loop-block%} is location of loop-block:
                                                        if block above loop-block is not block behind event-block:
                                                                if block over loop-block is not block behind event-block:
                                                                        delete {chest.%location of loop-block%}
                                send "{@tag} {@del.lock}"
                                stop
                        else:
                                cancel event
                else:
                        cancel event
on rightclick on sign:
        if line 1 of event-block is "[Blokada]":
                if {sign.%location of event-block%} is location of event-block:
                        send "{@tag} Wlascicielem skrzyni jest &c%{baza.%location of targeted block%::1}%"
                        send "{@tag} Dostep do skrzyni maja:"
                        send "{@tag} &c%{baza.%location of targeted block%::1}%"
                        if {baza.%location of targeted block%::2} is set:
                                send "{@tag} &c%{baza.%location of targeted block%::2}%"
                        if {baza.%location of targeted block%::3} is set:
                                send "{@tag} &c%{baza.%location of targeted block%::3}%"
                        if {baza.%location of targeted block%::4} is set:
                                send "{@tag} &c%{baza.%location of targeted block%::4}%"
                        if {baza.%location of targeted block%::5} is set:
                                send "{@tag} &c%{baza.%location of targeted block%::5}%"
                        if {baza.%location of targeted block%::6} is set:
                                send "{@tag} &c%{baza.%location of targeted block%::6}%"
                       
command /lock [<text>] [<text>]:
        trigger:
                if arg 1 is not set:
                        send "{@tag} Skrypt zabezpieczający skrzynie by &cWitek094"
                        send "{@tag} Aby dodac gracza wpisz &c/lock dodaj [nazwa_gracza]"
                        send "{@tag} Aby usunac gracza wpisz &c/lock usun [nazwa_gracza]"
                if arg 1 is "add" or "dodaj":
                        if {sign.%location of targeted block%} is location of targeted block:
                                if line 1 of targeted block is "[Blokada]":
                                        if {baza.%location of targeted block%::1} is name of player:
                                                size of {baza.%location of targeted block%::*} is less than {@ilosc.graczy}:
                                                        loop {baza.%location of targeted block%::*}:
                                                                if loop-value is arg 2:
                                                                        send "{@tag} Gracz posiada juz uprawnienia"
                                                                        stop
                                                        add arg 2 to {baza.%location of targeted block%::*}
                                                        send "{@tag} Dodano gracza"
                                                else:
                                                        send "{@tag} Nie mozesz dodac wiecej osob"
                                                        stop
                if arg 1 is "remove" or "usun":
                        if {sign.%location of targeted block%} is location of targeted block:
                                if line 1 of targeted block is "[Blokada]":
                                        if {baza.%location of targeted block%::1} is name of player:
                                                remove all arg 2 from {baza.%location of targeted block%::*}
                                                send "{@tag} Usunieto gracza %arg 2%"
Opublikowano

@topic

Powinno działać:


on place chest or wooden door or iron door or furnace or sign:
	set {lock.%location of target block%} to "%player%"
	message "&aPomyslnie zablokowano!"
on click on chest or wooden door or iron door or furnace or sign:
	if player has permission "blokada.ignoruj":
		stop
	else:
		if {lock.%location of clicked block%} is set:
			if {lock.%location of clicked block%} is "%player%":
				stop
			else:
				cancel event
				message "&cTen blok jest zablokowany!"
on break:
	if player has permission "blokada.ignoruj":
		if block above target block is chest or wooden door or iron door or furnace or sign:
			if {lock.%location of block above target block%} is set:
				if {lock.%location of block above target block%} is "%player%":
					stop
				else:
					cancel event
					message "&cTen blok jest zablokowany!"
on break chest or wooden door or iron door or furnace or sign:
	if player has permission "blokada.ignoruj":
		stop
	else:
		if {lock.%location of target block%} is set:
			if {lock.%location of target block%} is "%player%":
				stop
			else:
				cancel event
				message "&cTen blok jest zablokowany!"

f

Opublikowano

Działa.

Tylko teraz pytanie czy można by było zrobić komendę np /otworz

Która to zabezpieczenie zdejmie. I powiedzmy takie coś pod PEXem dla moderatora

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...