Skocz do zawartości
  • 0

Ulepszenie skryptu


LuckyEq
 Udostępnij

Pytanie

Witam, potrzebuje o pomoc, prosiłbym o ulepszenie tego skryptu i uporządkowanie oraz dodanie statusu online/offline, w takiej formie

  • ### PRZYKŁAD ###
    (Przedmiot to główka ze skinem danego gracza)
    Nick: NICK
    Ranga: ADMIN
    Status: ONLINE/OFFLINE
    Czym sie zajmuje: PORZADEK NA SERWERZE
    ### PRZYKŁAD ###
  • SKRYPT:
command /Administracja:
    trigger:
        open chest with 6 rows named "&4&lAdministracja Serwera" to player
        format slot 4 of player with 1 of Diamond named "&4&lWlasciciel - {NICK}" to run "komenda"
        format slot 0 of player with 1 of gray glass named " " to run "komenda"
        format slot 1 of player with 1 of gray glass named " " to run "komenda"
        format slot 2 of player with 1 of gray glass named " " to run "komenda"
        format slot 3 of player with 1 of gray glass named " " to run "komenda"
        format slot 5 of player with 1 of gray glass named " " to run "komenda"
        format slot 6 of player with 1 of gray glass named " " to run "komenda"
        format slot 7 of player with 1 of gray glass named " " to run "komenda"
        format slot 8 of player with 1 of gray glass named " " to run "komenda"
        format slot 9 of player with 1 of gray glass named " " to run "komenda"
        format slot 10 of player with 1 of gray glass named " " to run "komenda"
        format slot 11 of player with 1 of gray glass named " " to run "komenda"
        format slot 12 of player with 1 of gray glass named " " to run "komenda"
        format slot 13 of player with 1 of gray glass named " " to run "komenda"
        format slot 14 of player with 1 of gray glass named " " to run "komenda"
        format slot 15 of player with 1 of gray glass named " " to run "komenda"
        format slot 16 of player with 1 of gray glass named " " to run "komenda"
        format slot 17 of player with 1 of gray glass named " " to run "komenda"
        format slot 18 of player with 1 of gray glass named " " to run "komenda"
        format slot 19 of player with 1 of gray glass named " " to run "komenda"
        format slot 26 of player with 1 of gray glass named " " to run "komenda"
        format slot 21 of player with 1 of gray glass named " " to run "komenda"
        format slot 22 of player with 1 of gray glass named " " to run "komenda"
        format slot 23 of player with 1 of gray glass named " " to run "komenda"
        format slot 25 of player with 1 of gray glass named " " to run "komenda"
        format slot 12 of player with 1 of Emerald named "&4&lHeadAdmin - {NICK}" to run "komenda"
        format slot 14 of player with 1 of Emerald named "&4&lHeadAdmin - {NICK}" to run "komenda"
        format slot 20 of player with 1 of Lapis named "&a&lModerator - {NICK}" to run "komenda"        
        format slot 24 of player with 1 of Lapis named "&1&lPomocnik - {NICK}" to run "komenda"
        format slot 28 of player with 1 of Gold Ingot named "&6&lHeadBudowniczy - {NICK}" to run "komenda"        
        format slot 34 of player with 1 of Gold Ingot named "&6&lHeadBudowniczy - {NICK}" to run "komenda"
        format slot 31 of player with 1 of Iron Ingot named "&6&lBudowniczy - {NICK}" to run "komenda"
        format slot 26 of player with 1 of gray glass named " " to run "komenda"
        format slot 27 of player with 1 of gray glass named " " to run "komenda"
        format slot 29 of player with 1 of gray glass named " " to run "komenda"
        format slot 30 of player with 1 of gray glass named " " to run "komenda"
        format slot 32 of player with 1 of gray glass named " " to run "komenda"
        format slot 33 of player with 1 of gray glass named " " to run "komenda"
        format slot 35 of player with 1 of gray glass named " " to run "komenda"
        format slot 36 of player with 1 of gray glass named " " to run "komenda"
        format slot 37 of player with 1 of gray glass named " " to run "komenda"
        format slot 38 of player with 1 of gray glass named " " to run "komenda"
        format slot 39 of player with 1 of gray glass named " " to run "komenda"
        format slot 40 of player with 1 of gray glass named " " to run "komenda"
        format slot 41 of player with 1 of gray glass named " " to run "komenda"
        format slot 42 of player with 1 of gray glass named " " to run "komenda"
        format slot 43 of player with 1 of gray glass named " " to run "komenda"
        format slot 44 of player with 1 of gray glass named " " to run "komenda"
        format slot 45 of player with 1 of gray glass named " " to run "komenda"
        format slot 46 of player with 1 of gray glass named " " to run "komenda"
        format slot 47 of player with 1 of gray glass named " " to run "komenda"
        format slot 48 of player with 1 of gray glass named " " to run "komenda"
        format slot 49 of player with 1 of gray glass named " " to run "komenda"
        format slot 50 of player with 1 of gray glass named " " to run "komenda"
        format slot 51 of player with 1 of gray glass named " " to run "komenda"
        format slot 52 of player with 1 of gray glass named " " to run "komenda"
        format slot 52 of player with 1 of gray glass named " " to run "komenda"

 

 

Edytowane przez xNightPower_
Błąd
Nieaktywny

Zmieniam treść tytułu na poprawną.

Odnośnik do komentarza
Udostępnij na innych stronach

11 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
1 minutę temu, LuckyEq napisał:

Witam, potrzebuje o pomoc, prosiłbym o ulepszenie tego skryptu i uporządkowanie oraz dodanie statusu online/offline, w takiej formie

Już kiedyś dostałeś dwa skrypty na to, nie pamiętasz?

Co do samego kodu, wygląda bardzo źle. Zero pętli, masa 'format slot'.

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
3 minuty temu, Kormic napisał:

Już kiedyś dostałeś dwa skrypty na to, nie pamiętasz?

Co do samego kodu, wygląda bardzo źle. Zero pętli, masa 'format slot'.

Dlatego napisałem, prosiłbym o pomoc w ulepszeniu tego skryptu jak i dodanie tych przykładów które napisałem, kod który mi podawałeś kompletnie nie działał próbowałem robić wszystko ale niestety nadal nic.

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
19 minut temu, LuckyEq napisał:

Dlatego napisałem, prosiłbym o pomoc w ulepszeniu tego skryptu jak i dodanie tych przykładów które napisałem, kod który mi podawałeś kompletnie nie działał próbowałem robić wszystko ale niestety nadal nic.

W takim razie proszę.

function isPlayerOnline(p: offlineplayer) :: text:
	if {_p} is online:
		return "&aOnline"
	else:
		return "&cOffline"

command /Administracja:
	trigger:
		open chest inventory with 6 rows named "&4&lAdministracja Serwera" to player
		set slot (integers between 0 and 53) of player's current inventory to gray stained glass named " "
		set slot 4 of player's current inventory to skull of ("nick" parsed as offline player) named "Nick: {NICK}" with lore "Ranga: ADMIN", "Status: %isPlayerOnline(""nick"" parsed as offline player)%" and "Czym się zajmuje: PORZĄDEK NA SERWERZE"
		set slot 12 of player's current inventory to skull of ("nick" parsed as offline player) named "Nick: {NICK}" with lore "Ranga: ADMIN", "Status: %isPlayerOnline(""nick"" parsed as offline player)%" and "Czym się zajmuje: PORZĄDEK NA SERWERZE"
		set slot 14 of player's current inventory to skull of ("nick" parsed as offline player) named "Nick: {NICK}" with lore "Ranga: ADMIN", "Status: %isPlayerOnline(""nick"" parsed as offline player)%" and "Czym się zajmuje: PORZĄDEK NA SERWERZE"
		set slot 20 of player's current inventory to skull of ("nick" parsed as offline player) named "Nick: {NICK}" with lore "Ranga: ADMIN", "Status: %isPlayerOnline(""nick"" parsed as offline player)%" and "Czym się zajmuje: PORZĄDEK NA SERWERZE"     
		set slot 24 of player's current inventory to skull of ("nick" parsed as offline player) named "Nick: {NICK}" with lore "Ranga: ADMIN", "Status: %isPlayerOnline(""nick"" parsed as offline player)%" and "Czym się zajmuje: PORZĄDEK NA SERWERZE"
		set slot 28 of player's current inventory to skull of ("nick" parsed as offline player) named "Nick: {NICK}" with lore "Ranga: ADMIN", "Status: %isPlayerOnline(""nick"" parsed as offline player)%" and "Czym się zajmuje: PORZĄDEK NA SERWERZE"
		set slot 34 of player's current inventory to skull of ("nick" parsed as offline player) named "Nick: {NICK}" with lore "Ranga: ADMIN", "Status: %isPlayerOnline(""nick"" parsed as offline player)%" and "Czym się zajmuje: PORZĄDEK NA SERWERZE"
		set slot 31 of player's current inventory to skull of ("nick" parsed as offline player) named "Nick: {NICK}" with lore "Ranga: ADMIN", "Status: %isPlayerOnline(""nick"" parsed as offline player)%" and "Czym się zajmuje: PORZĄDEK NA SERWERZE"
		
on inventory click:
	name of player's current inventory is "&4&lAdministracja Serwera"
	clicked inventory is not player's inventory
	cancel event

W linijkach ustawiających główki w GUI musisz uzupełnić dwie rzeczy.

  1. Zastąp każde "nick" nazwą danego gracza.
  2. Uzupełnij sobie rangę oraz nazwę gracza w "NICK".
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
3 minuty temu, LuckyEq napisał:

Nie, 2.5.3 :)

 

No to masz naprawdę namieszane w nim.

Podaj proszę:

  • wersję serwera
  • wersję silnika
  • wersję Skripta (dokładną wraz z "wydawcą")
  • listę dodatków do Skripta
  • błędy w konsoli
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
14 minut temu, Kormic napisał:

No to masz naprawdę namieszane w nim.

Podaj proszę:

  • wersję serwera
  • wersję silnika
  • wersję Skripta (dokładną wraz z "wydawcą")
  • listę dodatków do Skripta
  • błędy w konsoli

Wersja serwera: 1.8.8
Wersja silnika: Spigot:
Wersja Skript: 2.5.3 Matocolotoe
Lista dodatków do SK: SkQuery, skRayFall, WildSkript
Błędy w konsoli:

 
Spoiler

 

[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! [Skript] Severe Error:
[10:29:00 ERROR]: #!#! Could not load test.sk
[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! Something went horribly wrong with Skript.
[10:29:00 ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[10:29:00 ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[10:29:00 ERROR]: #!#! Here is full list of them:
[10:29:00 ERROR]: #!#! skRayFall v1.9.20 (https://sk.rayfall.net/) WildSkript v1.8 (http://www.dzikoysk.net/) SkQuery v3.21.4
[10:29:00 ERROR]: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
[10:29:00 ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[10:29:00 ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[10:29:00 ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[10:29:00 ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[10:29:00 ERROR]: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! Stack trace:
[10:29:00 ERROR]: #!#! ch.njol.skript.SkriptAPIException: No class info found for lambda
[10:29:00 ERROR]: #!#! at ch.njol.skript.registrations.Classes.getClassInfo(Classes.java:262)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.createExprInfo(SkriptParser.java:1837)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.getExprInfo(SkriptParser.java:1804)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1552)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:223)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:178)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parseSingleExpr(SkriptParser.java:501)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parseExpression(SkriptParser.java:839)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1568)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1498)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1525)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1564)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1525)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:223)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:178)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.Condition.parse(Condition.java:80)
[10:29:00 ERROR]: #!#! at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:1110)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.function.ScriptFunction.<init>(ScriptFunction.java:45)
[10:29:00 ERROR]: #!#! at ch.njol.skript.lang.function.Functions.loadFunction(Functions.java:146)
[10:29:00 ERROR]: #!#! at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:650)
[10:29:00 ERROR]: #!#! at ch.njol.skript.ScriptLoader.lambda$4(ScriptLoader.java:401)
[10:29:00 ERROR]: #!#! at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:420)
[10:29:00 ERROR]: #!#! at ch.njol.skript.ScriptLoader.lambda$3(ScriptLoader.java:337)
[10:29:00 ERROR]: #!#! at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:370)
[10:29:00 ERROR]: #!#! at ch.njol.skript.Skript.reload(Skript.java:982)
[10:29:00 ERROR]: #!#! at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:161)
[10:29:00 ERROR]: #!#! at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
[10:29:00 ERROR]: #!#! at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
[10:29:00 ERROR]: #!#! at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13)
[10:29:00 ERROR]: #!#! at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[10:29:00 ERROR]: #!#! at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[10:29:00 ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[10:29:00 ERROR]: #!#! at java.lang.Thread.run(Thread.java:748)
[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! Version Information:
[10:29:00 ERROR]: #!#! Skript: 2.5.3 (latest)
[10:29:00 ERROR]: #!#! Flavor: github-matocolotoe-1.8
[10:29:00 ERROR]: #!#! Date: 2020-12-19
[10:29:00 ERROR]: #!#! Bukkit: 1.8.8-R0.1-SNAPSHOT
[10:29:00 ERROR]: #!#! Minecraft: 1.8.8
[10:29:00 ERROR]: #!#! Java: 1.8.0_202 (Java HotSpot(TM) 64-Bit Server VM 25.202-b08)
[10:29:00 ERROR]: #!#! OS: Linux amd64 3.10.0-1127.19.1.el7.x86_64
[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! Server platform: Spigot
[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! Current node: if {_p} is online: (test.sk, line 2)
[10:29:00 ERROR]: #!#! Current item: null
[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! Thread: Server thread
[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! Language: english
[10:29:00 ERROR]: #!#! Link parse mode: DISABLED
[10:29:00 ERROR]: #!#!
[10:29:00 ERROR]: #!#! End of Error.
[10:29:00 ERROR]: #!#!

 

 

Edytowane przez xNightPower_
Nieaktywny

Umieszczam błędy w spoilerze.

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
Teraz, LuckyEq napisał:

Wersja serwera: 1.8.8
Wersja silnika: Spigot:
Wersja Skript: 2.5.3 Matocolotoe
Lista dodatków do SK: SkQuery, skRayFall, WildSkript
Błędy w konsoli:

Włącz serwer bez dodatków i pokaż jak przerobiłeś skrypt.

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
7 minut temu, LuckyEq napisał:

Wszystko działa tylko tam, gdzie jest {NICK} to jak wpisuje komendę /administracja pisze LuckyEq: {NICK}

Ja zrobiłem to tak, jak chciałeś zrobić.

Na moje oko to miałeś zostawić sobie 'Nick:' i podmienić '{NICK}' na swój nick.

Odnośnik do komentarza
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Nieaktywny
Odpowiedz na pytanie...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...