Skocz do zawartości
  • 0

Topki w Gui


mateuszeqq13212

Pytanie

9 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

np tak

on load:
    set {symbol} to " ---> "
function createTop(t: string, i: integer) :: strings:
    set {_offlinePlayers::*} to all offline players
    loop {_offlinePlayers::*}:
        if {%{_t}%::%loop-value%} is set:
            add {%{_t}%::%loop-value%} to {_top::*}
            add loop-value to {_players::*}
    loop {_i} times:
        set {_max} to max({_top::*})
        loop {_top::*}:
            if loop-value-2 = {_max}:
                set {_index} to loop-index
                delete {_top::%{_index}%}
        add "%{_players::%{_index}%}%%{symbol}%%{_max}%" to {_return::*}
        delete {_players::%{_index}%}
    return {_return::*}
function getTop(t: string, list: strings) :: strings:
    loop {_list::*}:
        set {_split::*} to loop-value split at {symbol}
        add {_split::1} to {_players::*}
        add {_split::2} to {_top::*}
    if {_t} = "players":
        return {_players::*}
    else:
        return {_top::*}

options:
	format: &f{TOP}. &7{NICK} &8» &3{VALUE} blokow
command /top [<text>]:
	trigger:
		open chest with 1 rows named "&7Topki" to player
		set {_topki::*} to createTop("Stone", 8)
		set {_i} to diamond named "&7Top wykopanego Stona"
		set {_line} to 1
		loop {_topki::*}:
			set {_list::*} to loop-value split at " ---> "
			set {_f} to "{@format}"
			replace all "{TOP}" with "%loop-index%" in {_f}
			replace all "{NICK}" with "%{_list::1}%" in {_f}
			replace all "{VALUE}" with "%{_list::2}%" in {_f}
			set line {_line} of lore of {_i} to colored {_f}
			add 1 to {_line}
		set player's current inventory's slot 0 to {_i}
on mine:
	if event-block is stone:
		add 1 to {Stone::%player%}

potem to całe można dać do funkcji i tworzyć tak kolejne topki

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
26 minut temu, xAxee napisał:

np tak


on load:
    set {symbol} to " ---> "
function createTop(t: string, i: integer) :: strings:
    set {_offlinePlayers::*} to all offline players
    loop {_offlinePlayers::*}:
        if {%{_t}%::%loop-value%} is set:
            add {%{_t}%::%loop-value%} to {_top::*}
            add loop-value to {_players::*}
    loop {_i} times:
        set {_max} to max({_top::*})
        loop {_top::*}:
            if loop-value-2 = {_max}:
                set {_index} to loop-index
                delete {_top::%{_index}%}
        add "%{_players::%{_index}%}%%{symbol}%%{_max}%" to {_return::*}
        delete {_players::%{_index}%}
    return {_return::*}
function getTop(t: string, list: strings) :: strings:
    loop {_list::*}:
        set {_split::*} to loop-value split at {symbol}
        add {_split::1} to {_players::*}
        add {_split::2} to {_top::*}
    if {_t} = "players":
        return {_players::*}
    else:
        return {_top::*}

options:
	format: &f{TOP}. &7{NICK} &8» &3{VALUE} blokow
command /top [<text>]:
	trigger:
		open chest with 1 rows named "&7Topki" to player
		set {_topki::*} to createTop("Stone", 8)
		set {_i} to diamond named "&7Top wykopanego Stona"
		set {_line} to 1
		loop {_topki::*}:
			set {_list::*} to loop-value split at " ---> "
			set {_f} to "{@format}"
			replace all "{TOP}" with "%loop-index%" in {_f}
			replace all "{NICK}" with "%{_list::1}%" in {_f}
			replace all "{VALUE}" with "%{_list::2}%" in {_f}
			set line {_line} of lore of {_i} to colored {_f}
			add 1 to {_line}
		set player's current inventory's slot 0 to {_i}
on mine:
	if event-block is stone:
		add 1 to {Stone::%player%}

potem to całe można dać do funkcji i tworzyć tak kolejne topki

Błędy :/

Spoiler

[Skript][m Reloading top.sk[m...

[15:58:43] [Server thread/ERROR]: {_offlinePlayers::*} can"t be set to "all offline players" because the latter is not an object (top.sk, line 4: set {_offlinePlayers::*} to all offline players")

[15:58:43] [Server thread/INFO]: [Skript][m Encountered 1 error while reloading top.sk[m!

 

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
27 minut temu, mateuszeqq13212 napisał:

Błędy :/

Zarejestruj się lub zaloguj, aby zobaczyć ukrytą treść! Ukryj zawartość

[Skript][m Reloading top.sk[m...

[15:58:43] [Server thread/ERROR]: {_offlinePlayers::*} can"t be set to "all offline players" because the latter is not an object (top.sk, line 4: set {_offlinePlayers::*} to all offline players")

[15:58:43] [Server thread/INFO]: [Skript][m Encountered 1 error while reloading top.sk[m!

 

 

No to zrób przy evencie on join remove player from {lista::*} Add player to {lista::*} i to all offline players zamień na tą liste

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
1 minutę temu, mateuszeqq13212 napisał:

To teraz to..

Zarejestruj się lub zaloguj, aby zobaczyć ukrytą treść!

no bo żadna wartość nie jest zapisana... (ja tam dałem zmienna {Stone::%player%})

Edytowane przez xAxee
Odnośnik do komentarza
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

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