Aller au contenu
  • 0

Scoreboard dans un seul "serveur"


Question

Posté(e)

Bonjour/Bonsoir,

 

Version Skript : dev27

Version Minecraft : 1.8.9

 

J'utilise 2 api l'api de @GidiX qui est LinkServer et un api de scoreboard qui est celle de KevinDoesMC

 

Le problème étant que je ne comprend pas comment faire pour afficher le scoreboard que pour les joueur étant sur les groupe de serveur "hub"

 

Voici min code:

 

# SkBoard 2.0 - KevinDoesMC

every 1 second:


   #! Set Main Board (If you want no default board, put "N/A")
   set {_mainboard} to "Main"

   #! Board Creation
   #! Split each line of a board with "[nl]"!
   #! In this version of SkBoard, you cannot have title frames. If I find a decent way to do it without decreasing the tps too much, I'll add it.
   #! Each board line has a max of 36 characters (not bolded). If you have variables in there and it reaches over 36, SkBoard will make the line end at 36. (Will break if you have color codes.)
   #! The board title has a max of 30 characters (not bolded). If you have variables in there and it reaches over 36, SkBoard will make the line end at 32. (Will break if you have color codes.)


   #! How to make variables on the board.
   #Say you want the variable "{gatt.is.bae}". You'd be fine just putting "%{gatt.is.bae}%"!
   #If you wanted a variable like "{playerstats::%uuid of loop-player%}", look at the examples below this.

   #%{rank::%uuid of loop-player%}% -> [{rank::[uuid of player]}]
   #%{rank::%loop-player%}% -> [{rank::[player]}]

   #! List of Variable Hooks
   #[player], [p] = player
   #[playeruuid] = player's uuid (useful when dealing with variables.)
   #[playersonline], [players] = player's online
   #[x], [y], [z] = shows the coordinates of the player (x, y, or z)

   #! Toggleable Hooks (You need to go down just below the loop all players: and find the Toggleable Hook section!)
   #[playerping], [ping] = player's ping
   #[tps] = server's tps
   #[bal], [money] = player's money
   #[maxp], [maxplayers] = max players
   #! Remember to toggle them below before using! (They will show as "<none>" if you don't!)$
   loop allPlayersInGroup("hub"):


       set {online} to number of all players
       set {_boards::Main} to "[nl]SCOREBOARD[nl]"
       set {_boards.title::Main} to "TITRE ICI"

       #! Toggleable Hooks! (For those who want to use expressions from other addons!)
       #! Just remove the "#" before the set effect!

       #set {_maxplayers} to max players
       #set {_ping} to loop-player's ping
       #set {_tps} to tps
       #set {_balance} to player's money

       #! No need to toggle these! (They come in default Skript.)

       set {_p} to loop-player
       set {_uuid} to "%uuid of {_p}%"
       set {_po} to size of all players
       set {_x} to rounded x coordinate of loop-player
       set {_y} to rounded y coordinate of loop-player
       set {_z} to rounded z coordinate of loop-player
       set {_now} to now


       clear {_board::*}
       clear {_line::*}
       clear {_noboard}
       if {Skboard:%uuid of loop-player%} is set:
           set {_board} to {_boards::%{Skboard::%uuid of loop-player%}%}
       else:
           if {_mainboard} is "N/A":
               wipe loop-player's sidebar
               set {_noboard} to true
           else:
               if {_boards::%{_mainboard}%} is set:
                   set {_board} to {_boards::%{_mainboard}%}
                   set {_title} to "%coloured {_boards.title::%{_mainboard}%}%"
       if {_noboard} is not set:
           replace all "[player]" and "[p]" in {_board} with "%{_p}%"
           replace all "[player]" and "[p]" in {_title} with "%{_p}%"
           replace all "[uuid]" and "[playeruuid]" in {_board} with "%{_uuid}%"
           replace all "[uuid]" and "[playeruuid]" in {_title} with "%{_uuid}%"
           replace all "[players]" and "[playersonline]" in {_board} with "%{_po}%"
           replace all "[players]" and "[playersonline]" in {_title} with "%{_po}%"
           replace all "[tps]" in {_board} with "%{_tps}%"
           replace all "[tps]" in {_title} with "%{_tps}%"
           replace all "[x]" in {_board} with "%{_x}%"
           replace all "[x]" in {_title} with "%{_x}%"
           replace all "[y]" in {_board} with "%{_y}%"
           replace all "[y]" in {_title} with "%{_y}%"
           replace all "[z]" in {_board} with "%{_z}%"
           replace all "[z]" in {_title} with "%{_z}%"
           replace all "[bal]" and "[money]" in {_board} with "%{_bal}%"
           replace all "[bal]" and "[money]" in {_title} with "%{_bal}%"
           replace all "[now]" in {_board} with "%{_now}%"
           replace all "[now]" in {_title} with "%{_now}%"
           replace all "[maxp]" and "[maxplayers]" in {_board} with "%{_maxplayers}%"
           replace all "[maxp]" and "[maxplayers]" in {_title} with "%{_maxplayers}%"
           replace all "[{" in {_board} with "%%{"
           replace all "[{" in {_title} with "%%{"
           replace all "}]" in {_board} with "}%%"
           replace all "}]" in {_title} with "}%%"
           evaluate "set {_board} to ""%{_board}%"""
           evaluate "set {_title} to ""%{_title}%"""
           set {_board::*} to {_board} split at "[nl]"
           clear {_createdboard}
           set {_line} to 16
           loop {_board::*}:
               remove 1 from {_line}
               set {_line::%{_line}%} to "%coloured loop-value-2%"
           if side bar is set for loop-player-1:
               if length of {_title} is more than 30:
                   if {SkBoard::LastTitle.::%uuid of loop-player-1%} is not {_title}:
                       set {_title} to the first 30 characters of {_title}
                       set {SkBoard::LastTitle.::%uuid of loop-player-1%} to "%{_title}%"
                       set name of sidebar of loop-player-1 to "%{_title}%"
               else:
                   if {SkBoard::LastTitle.::%uuid of loop-player-1%} is not {_title}:
                       set name of sidebar of loop-player-1 to "%{_title}%"
                       set {SkBoard::LastTitle.::%uuid of loop-player-1%} to "%{_title}%"
           else:
               set {_createdboard} to true
           if {_createdboard} is true:
               set name of sidebar of loop-player-1 to "%{_title}%"
               set {SkBoard::LastTitle.::%uuid of loop-player-1%} to "%{_title}%"
           set {_line} to 16
           loop 15 times:
               remove 1 from {_line}
               if {_line::%{_line}%} is set:
                   if {_line} is less than 11:
                       set {_c} to {_line}-1
                       set {_c} to coloured "&%{_c}%&r"
                   else:
                       if {_line} is 15:
                           set {_c} to coloured "&f&r"
                       else if {_line} is 14:
                           set {_c} to coloured "&e&r"
                       else if {_line} is 13:
                           set {_c} to coloured "&d&r"
                       else if {_line} is 12:
                           set {_c} to coloured "&c&r"
                       else if {_line} is 11:
                           set {_c} to coloured "&b&r"
                   if length of {_line::%{_line}%} is more than 36:
                       set {_line::%{_line}%} to the first 36 characters of {_line::%{_line}%}
                   else:
                       if {_createdboard} is set:
                           create id based score "%{_c}%%coloured {_line::%{_line}%}%" in sidebar of loop-player-1 to {_line} with id "%{_line}%.%uuid of loop-player-1%"
                       else:
                           if score name of id "%{_line}%.%uuid of loop-player-1%" is not "%{_c}%%coloured {_line::%{_line}%}%":
                               if score name of id "%{_line}%.%uuid of loop-player-1%" is not set:
                                   create id based score "%{_c}%%coloured {_line::%{_line}%}%" in sidebar of loop-player-1 to {_line} with id "%{_line}%.%uuid of loop-player-1%"
                               else:
                                   edit score with id "%{_line}%.%uuid of loop-player-1%" to "%{_c}%%coloured {_line::%{_line}%}%" and {_line}
                           else:
                               if score name of id "%{_line}%.%uuid of loop-player-1%" is not set:
                                   create id based score "%{_c}%%coloured {_line::%{_line}%}%" in sidebar of loop-player-1 to {_line} with id "%{_line}%.%uuid of loop-player-1%"
               else:
                   remove score id "%{_line}%.%uuid of loop-player-1%"
on quit:
   clear {SkBoard::LastTitle::%uuid of player%}
   clear {SkBoard::%uuid of player%}
on skript load:
   clear {SkBoard::*}
   loop all players:
       wipe loop-player's sidebar

 

Merci d'avance pour votre aide

2 réponses à cette question

Messages recommandés

×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.