Jump to content

Recommended Posts

BEFORE READING:
1) If you have skrayfall installed, you must disable the enableFastScoreBoards option in skrayfall's config.yml

2) A scoreboard line can not be set to nothing, if you want an empty line, you must set it to a color code (e.g. "&0")

3) Two different scoreboards line can not have the same text, a work around is yet again by using color codes as seen above (e.g. "&eText" and "&1&eText" to display 2 lines the same)

4) There are 3 addons labelled skbee on minehut's download page, make sure you download the one that's description is "A simple solution to make your servers more bold!"


INTRO

Following the introduction of the new add-on skbee, i thought it'd be wise to create a scoreboard tutorial using the add-on. The only semi-viable options for minehut users prior to this add-ons introduction were skellet and skrayfall, which both had their issues. Noticeably, skellet had large parsing times and unnecessarily complex syntaxes and skrayfall scoreboards flickered.

important: if you are attempting to support 1.8 clients on your minehut server using protocolsupport for example, your skbee scoreboard lines will cut off at after 16 characters  for those 1.8 users

READING SYNTAX PATTERNS (syntaxes are ways you can write code)

for this tutorial, i will be providing the syntax patterns and example code. In the chance that you do not want to use this template, this is how you interpret skript's syntax patterns. If you do not understand, this do not worry. This is for more advanced users.

  • %% = an object/objects (e.g. player(s) or string(s))
  • [] = optional, meaning it is not mandatory
  • (option 1|option 2) = interchangeable, but only one can be used

For example, all these patterns are correct for the syntax [score]board of %player% is (on|off):

  • scoreboard of player is on
  • scoreboard of player is off
  • board of player is on
  • board of player is off

there are 6 simple, sufficient syntaxes provided by skbee which include:

Screenshot (95).png

 

SETTING UP YOUR SCOREBOARD
 

When making player specific scoreboards, we only want their scoreboard to exist when they're online (duh). Therefore, we need to listen to two player specific events: on join and on disconnect.

Luckily for us, if we use one of skbee's syntaxes (set line or set title), skbee will automatically handle setting up a player's scoreboard for us, so we don't need a syntax like create scoreboard. Useful, right? What this means, is that all we need to do is set the title and lines of our scoreboard and we're all done!

on join:
	set title of player's scoreboard to "my server!"
	set line 3 of player's scoreboard to "top line"
	set line 2 of player's scoreboard to "middle line"
	set line 1 of player's scoreboard to "bottom line"

2020-04-01_20.37.20.png

 Note: minecraft scoreboards always displays the lines highest to lowest from top to bottom (3, 2, 1 instead of 1, 2, 3)

Cool! we've got a scoreboard. Simple. However, odds are you're going to want to have variables on your scoreboard, right?

For this example, I will be displaying online players on the scoreboard

There are two ways of updating your scoreboard. For this tutorial we're going to be using a while loop as it is easier to use. For more advanced users, see the advanced scoreboards header for more efficient methods

a while loop basically means, for as long as a certain statement (condition) is true, repeat something. Here's an example of it put in to use (along with the use of some colour codes)

on join:
	set title of player's scoreboard to "&6&lServer Info"
	while player is online:
		set line 1 of player's scoreboard to "&7• &eOnline: &f%size of all players%"
		wait 1 second

2020-04-01_22_15_59.thumb.png.5d538922b1e53d97bfd99ee15bcc8f8d.png

Great! Now we've got a scoreboard that will accurately display the amount of online players. It's important to remember that this works for more than just online players, and you can make it display any skript variable you'd like by including %{variable}%

When the player leaves the server we want to clear their scoreboard because we don't want to store unnecessary data for players if they're not online. We can do this easily by including:

on disconnect:
	clear player's scoreboard

And that's all there is to it! I hope you've found this tutorial useful, if you have any requests for tutorials on anything else please let me know.

Skbee download link: https://www.spigotmc.org/resources/skbee-skript-addon.75839/

 

ADVANCED SCOREBOARDS

note: I will not being going in to as much detail here, if you don't understand the content below i suggest you stick with the first method

as i'm sure some of you are all aware, having a while loop that loops every 1 second for all players isn't the best way of updating a scoreboard in some cases

A better more complicated method for scoreboards that display data that's manipulation is easily detectable is by passing the setting of lines to an updateBoard() function. For this example i will be using player kills and deaths

function updateBoard(p: player):
	set {_uuid} to {_p}'s uuid
	set line 2 of {_p}'s scoreboard to "&6Kills: &f%{kills::%{_uuid}%} ? 0%"
	set line 1 of {_p}'s scoreboard to "&6Deaths: &f%{deaths::%{_uuid}%} ? 0%"
    
on join:
	set title of player's scoreboard to "&e&lStats"
	updateBoard(player)
    
on death of player:
	add 1 to {deaths::%victim's uuid%}
	if attacker is a player:
		add 1 to {kills::%attacker's uuid%}
	updateBoard(victim)
	updateBoard(attacker)

on disconnect:
	clear scoreboard of player

Notice how on join we don't require a loop, merely the initial set up of the lines. Instead, we listen in on the on death event, allowing us to only update the scoreboard of the victim and attacker when the information displayed on their boards change.

If your scoreboard is not player-specific, but still contains variables that frequently change, it might be better for you to structure your updateBoard() function like so:

function updateBoard(p: players):
	loop {_p::*}:
		set line 1 of loop-value's scoreboard to "..."

 

Edited by Ofus-Will
  • Like 1
Link to post
Share on other sites

Nice - kinda related to scoreboards but could you tell me what the thing is for displaying pex ranks on a scoreboard? Obviously %rank% doesn't work.

Hey there, I'm just that person that goes all out on everything 😂 I currently host an event called Minehut Mondays, where players compete for a reward. I have fully scripted SkyBlock and (with help) UHC. If you want a simple minigame set up feel free to message me here or on Discord Ezekia#5644 🙂

IMG_1036.PNG

lolololol.PNG

lmao.PNG

Link to post
Share on other sites
On 4/6/2020 at 8:02 PM, Ezekia said:

Nice - kinda related to scoreboards but could you tell me what the thing is for displaying pex ranks on a scoreboard? Obviously %rank% doesn't work.

it's just %player's rank%, alternatively you can use %player's prefix%. Both require a valid group plugin to work

  • Like 1
Link to post
Share on other sites
4 hours ago, Ofus-Will said:

it's just %player's rank%, alternatively you can use %player's prefix%. Both require a valid group plugin to work

i'm stupid - i've tried everything but that lol

Hey there, I'm just that person that goes all out on everything 😂 I currently host an event called Minehut Mondays, where players compete for a reward. I have fully scripted SkyBlock and (with help) UHC. If you want a simple minigame set up feel free to message me here or on Discord Ezekia#5644 🙂

IMG_1036.PNG

lolololol.PNG

lmao.PNG

Link to post
Share on other sites
On 4/9/2020 at 2:17 PM, xlr100 said:

Cool tutorial, good job!

Should probably go into more details about group specific scoreboards (Like mini-games)

this tutorial was more focused on the conceptual idea of scoreboards, i feel like situation-specific scoreboards aren't actually related to scoreboards, but rather custom mechanisms that can be displayed on the scoreboard. 

Link to post
Share on other sites
  • 1 month later...

Necroposting, or replying on posts that haven’t been replied to in over a month is not allowed, unless the post is still relevant such as an active giveaway or a tutorial post

its a tutorial : )

how do i display balance on this scoreboard. but fixed so it doesnt display 1.99999999999.

 

Link to post
Share on other sites
  • 2 months later...
20 hours ago, JettResetYT said:

Can you make a /start skript to give the player that types it a wood_pickaxe 1 unbreakbable

please

 

im not toooo sure about the enchants but its pretty easy

command /start:

  trigger:

    give player wooden pickaxe with unbreakable 999

 

Hey there, I'm just that person that goes all out on everything 😂 I currently host an event called Minehut Mondays, where players compete for a reward. I have fully scripted SkyBlock and (with help) UHC. If you want a simple minigame set up feel free to message me here or on Discord Ezekia#5644 🙂

IMG_1036.PNG

lolololol.PNG

lmao.PNG

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...