Jump to content

looping scoreboard in skript


YodaForce157

Recommended Posts

hi so ive made a scoreboard and would like it to be looped so it updates it ever 2 seconds but i get the error cant understand this event : "every 2 seconds in world "world":"

my skript is 
every 2 seconds in world "world":
    loop all players:
        wipe loop-player's sidebar
        set name of sidebar of loop-player to "&9Space&bPlots!"
        set score "&b➥ &b%LOOP-PLAYER%" in sidebar of loop-player to 12
        set score "&b➥ Balance %loop-player's balance%" in sidebar of loop-player to 11
        set score "&b➥ Rank:%loop-player's prefix%%LOOP-PLAYER%" in sidebar of loop-player to 10
        set score "&b" in sidebar of loop-player to 9
        set score "&b➥ SpacePlots.minehut.gg" in sidebar of loop-player to 8
        set score "&b➥ Online %amount of players%/20" in sidebar of loop-player to 7
Please help!

Link to comment
Share on other sites

15 minutes ago, YodaForce157 said:

hi so ive made a scoreboard and would like it to be looped so it updates it ever 2 seconds but i get the error cant understand this event : "every 2 seconds in world "world":"

my skript is 
every 2 seconds in world "world":
    loop all players:
        wipe loop-player's sidebar
        set name of sidebar of loop-player to "&9Space&bPlots!"
        set score "&b➥ &b%LOOP-PLAYER%" in sidebar of loop-player to 12
        set score "&b➥ Balance %loop-player's balance%" in sidebar of loop-player to 11
        set score "&b➥ Rank:%loop-player's prefix%%LOOP-PLAYER%" in sidebar of loop-player to 10
        set score "&b" in sidebar of loop-player to 9
        set score "&b➥ SpacePlots.minehut.gg" in sidebar of loop-player to 8
        set score "&b➥ Online %amount of players%/20" in sidebar of loop-player to 7
Please help!

every 2 seconds in "world"

Discord: neo?#1200

First JoinDecember 17th, 2015

VIP: 23/08/2019

Minecraft Username: nullific

santioNERD.png.c68b0fda25a448bcbe3278033a7987b2.png

Link to comment
Share on other sites

i often use functions, e.g:

on chat:
	sbRefresh(player)

function sbRefresh(p: player):
	wipe {_p}'s sidebar
	set {_uuid} to uuid of {_p}
	set name of sidebar of {_p} to "&cservername"
	set score " " in sidebar of {_p} to 9
	set score "&erandomvar: %{varofplayer::%{_uuid}%}%" in sidebar of {_p} to 8
	set score "  " in sidebar of {_p} to 7

 

Discord: neo?#1200

First JoinDecember 17th, 2015

VIP: 23/08/2019

Minecraft Username: nullific

santioNERD.png.c68b0fda25a448bcbe3278033a7987b2.png

Link to comment
Share on other sites

on join:
	while player is online:
		updateSidebar(player)
		wait 3 ticks

function updateSidebar(p: player):
	# Update sidebar here

This will update every 3 ticks in a efficient manner, just remember to rejoin once you update or add this skript, and never remove the wait

Santio71 -> Developer

Development Lead for Minehut Events Team


First Joined: Jan. 24, 2016

[VIP]~2019

Joined CET: July 22, 2019 (About 1.75 years ago) 

[PRO]: May 6, 2020

Rejoined CET: June 15, 2020

Moderator: December 19, 2022

himods_1_464x213.pngok3.png.9f407538426375980dbfd1a70bd93a74.pngok2.png.2d1e6960fee974293bc3aaebeb41d5db.png

Link to comment
Share on other sites

12 hours ago, OMGPandaYT2 said:

i actually would probaly just prefer:

every 2 seconds:

 

instead of using functions and 'every 2 seconds in "world":'

 

You will probably get a skript error if you have multiple worlds and you aren't including the world part.

First Joined: July 2015
VIP: January 2020
Jr.Mod: 1st April 2020
Mod: 16th July 2020

Info:

~ Skript Developer
~ Discord: @nicholxs#0001
~ Previous names: Nichxlxs, Deterno, iHaveSkills, Retrical

Link to comment
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...