#.scoreboardIdentity stopped working
1 messages · Page 1 of 1 (latest)
show the code.
i’ll just send my scripts folder, you dont seem to understand, it’s in EVERY SINGLE SCRIPT FILE WITH SCOREBOARD
give me a sec
I do understand.
if I help with 1 script, it can help you fix the others.
what part of my script do you want???
what do you think??
fine, ill send the entire setActionBar.js file in message
what the logs are referencing.
import { system, world } from "@minecraft/server"
let lastTickTime = Date.now();
function lagReaderServerMs() {
const currentTime = Date.now();
const tickDuration = currentTime - lastTickTime;
lastTickTime = currentTime;
const expectedTickDuration = 50; // 1 tick = 50 ms
const lag = tickDuration - expectedTickDuration;
return { lag }
}
let checkTime = Date.now();
let currentTicks = 0;
let tps = 0;
function lagReaderTps() {
currentTicks++;
const currentTime = Date.now();
if (currentTime - checkTime > 970) {
tps = currentTicks;
checkTime = currentTime;
currentTicks = 0;
}
return { tps }
}
system.runInterval(() => {
const tps = lagReaderTps().tps;
const lag = lagReaderServerMs().lag;
const absLag = lag < 0 ? 0 : lag
const color = ['a', 'e', 'g', '6', 'c', '4'];
for (const player of world.getPlayers()) {
const coins = world.scoreboard.getObjective("coins").getScore(player.scoreboardIdentity)
const kills = world.scoreboard.getObjective("kills").getScore(player.scoreboardIdentity)
const deaths = world.scoreboard.getObjective("deaths").getScore(player.scoreboardIdentity)
player.onScreenDisplay.setActionBar(`§eCoins: ${coins} \n${world.scoreboard.getObjective("ascensionPoints").getScore(player.scoreboardIdentity) === undefined || world.scoreboard.getObjective("ascensionPoints").getScore(player.scoreboardIdentity) === 0 ? "" : `§5Ascension Points: ${world.scoreboard.getObjective("ascensionPoints").getScore(player.scoreboardIdentity)}§r\n`}§aKills: ${kills}\n§cDeaths: ${deaths}\n§r§${Math.floor(absLag / 10) >= color.length ? '4' : color[Math.floor(absLag / 10)]}${absLag} ms §i|§r Ticks/s: §b${tps}`);
}
});```
ther
so line 31 is where it starts in that file alone
the player is not a participant yet.
to make an entity participate, you need to give them score first.
it can be 0
i thought minecraft added all players as a scoreboard participant on its own ;-;
so use world.afterEvents.playerSpawn...
give them a score 0.
this should fix this issue.
ok.
no
in a new script file, ill add all spawning players 0 to every score
at least i have logic to check for score 0 to not show it…
and you need to use a tag or dyanmic property to make sure their score doesnt get reset after rejoining
no, ill just do scoreboard players add @s __ 0
but in script form
you should get it
do you understand why im suggesting this
Actually I have a .mcfunction that already does that for coins, kills, and deaths
so i can just expand it for every other score
it’s been holding me well
execute as @a[scores={coins=!-2147483647..}] run scoreboard players add @a coins 0```